Git Product home page Git Product logo

Comments (10)

morvy avatar morvy commented on July 18, 2024 1

@StSaens @duracelltomi how should be an empty email handled? Now even empty string is hashed and empty string does generate a hash, so I believe this is not correct too.

I have this in my "hotfixes":

add_filter( 'gtm4wp_compile_datalayer', function($dataLayer) {
    if (empty(trim($dataLayer['customerBillingEmail']))) {
	$dataLayer['customerBillingEmailHash'] = "";
    }

    return $dataLayer;
}, 99, 1 );

from gtm4wp.

duracelltomi avatar duracelltomi commented on July 18, 2024

Hi,

Thanks for pointing this out.
I am quite sure most of those sanitizations are done while WooCommerce processes the email address.

Have you tried to place an order entering an email address that doesn't fulfill any of those requirements?

from gtm4wp.

StSaens avatar StSaens commented on July 18, 2024

Hi.
Point 2 and 4 are for sure not done by woo.

from gtm4wp.

duracelltomi avatar duracelltomi commented on July 18, 2024

Thanks!

v1.20 will be released tomorrow, although this code seems to me a low risk change, I will add it into either 1.20.1 or 1.21

from gtm4wp.

duracelltomi avatar duracelltomi commented on July 18, 2024

Partly done: 4aad785

TODO:

  • Format phone numbers according to the E164 standard.
  • Remove all periods (.) that precede the domain name in gmail.com and googlemail.com email addresses.

from gtm4wp.

duracelltomi avatar duracelltomi commented on July 18, 2024

... and 3f141f0

from gtm4wp.

duracelltomi avatar duracelltomi commented on July 18, 2024

I've added better normalization into the next version:
a08afa9

However I have doubts adding phone number formatting as it seems to be a more complex code that I though. I've found this library but adding this to GTM4WP would be a large addition for one specific feature:
https://github.com/giggsey/libphonenumber-for-php

Currently, I think some sort of normalization should be added into WooCommerce itself so that all plugins can benefit from the results.

from gtm4wp.

StSaens avatar StSaens commented on July 18, 2024

Great that the email formatting is implemented. Happy with that. Should be enough for most eCommerce shops.

With regards to the phone nr. That will mean that, unless the customer inputs it exactly right, Google won't be able to match that hash for enhanced conversion tracking. Maybe this should be clarified somewhere in gtm4wp docs.

from gtm4wp.

duracelltomi avatar duracelltomi commented on July 18, 2024

@morvy customerBillingEmailHash is not the right variable to use.

https://gtm4wp.com/google-tag-manager-for-woocommerce/enhanced-conversions-for-google-ads-with-woocommerce-how-to-setup

Variables in orderData are filtered to prevent hashing of empty strings.

I will fix this with customerBillingEmailHash too

from gtm4wp.

duracelltomi avatar duracelltomi commented on July 18, 2024

@morvy 42ef9d2

from gtm4wp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.