Comments (10)
@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.
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.
Hi.
Point 2 and 4 are for sure not done by woo.
from gtm4wp.
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.
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.
... and 3f141f0
from gtm4wp.
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.
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.
@morvy customerBillingEmailHash is not the right variable to use.
Variables in orderData are filtered to prevent hashing of empty strings.
I will fix this with customerBillingEmailHash too
from gtm4wp.
from gtm4wp.
Related Issues (20)
- Notice: Undefined variable: blocking_cookie HOT 3
- String vs integer in add_to_cart HOT 2
- Partytown JS HOT 2
- Cannot set Container code to ON HOT 1
- 503 error on cart and checkout HOT 3
- Include new_customer in GA4 purchase too HOT 2
- Unprotected headers used for IP address HOT 4
- `add_shipping_info` and `add_payment_info` events not being triggered by order submit button at checkout HOT 1
- Cannot track add to cart event on products lists HOT 5
- User data for Enhanced Ecommerce HOT 4
- Problem with the "purchase" event HOT 17
- Google Tag Manager is loaded even though setting is turned off HOT 12
- String vs id in view_item_details HOT 8
- Uncaught TypeError: Cannot read properties of null (reading 'scrollTop') HOT 2
- view_item only active if variations selected HOT 5
- EVENT PURCHASE DON'T FIRE ON LINK ORDER PAY WOOCOMMERCE HOT 24
- Add Custom Fields to datalayer HOT 8
- Clicking on a product only loads browser after 2-3 secondes. HOT 5
- DataLayer BUG in variable product HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gtm4wp.