Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataLayer not compliant with Google specifications. #348

Open
Tom-nn opened this issue May 2, 2024 · 3 comments
Open

DataLayer not compliant with Google specifications. #348

Tom-nn opened this issue May 2, 2024 · 3 comments

Comments

@Tom-nn
Copy link

Tom-nn commented May 2, 2024

Hello.
Very cool plugin, but auditing the dataLayer I discovered that a part is not compatible with the Google specification.

view_item_list - price not numeric
select_item - price is not numeric
view_item - value and price are not numeric, quantity is missing, instead of variant should be item_variant
add_to_cart - value, price and quantity are not numeric, instead of variant should be item_variant
remove_from_cart - price and quantity are not numeric
event: "view_cart" is at the end, after ecommerce: and should be before
event: "begin_checkout" is at the end, after ecommerce: a should be before
purchase - affiliation should be in items not in ecommerce (and affiliation is missing in previous steps)

Coupons are not working, making the price inconsistent on the purchase path and the value wrong:
view_cart - coupon and discount are missing in items
remove_from_cart - coupon and discount are missing in items
begin_checkout - coupon is missing in ecommerce and items, discount is missing in items
add_shipping_info - missing coupon in ecommerce and items, missing discount in items
add_payment_info - coupon is missing in ecommerce and items, discount is missing in items
purchase - missing coupon and discount in items

@Tom-nn
Copy link
Author

Tom-nn commented May 13, 2024

While auditing the analytics implemented with the plugin, I found another mistake, but in the documentation rather than in the scripts. In the instructions for enabling Enhanced Conversion for Google Ads (https://gtm4wp.com/google-tag-manager-for-woocommerce/enhanced-conversions-for-google-ads-with-woocommerce-how-to-setup) is to provide variables with hashed values in the “Email”, “Phone”, “First Name” and “Last Name” fields. But according to Google's documentation (https://support.google.com/google-ads/answer/13262500?sjid=15788915886387418000-EU#zippy=%2Cidentify-and-define-your-enhanced-conversions-variables), Key Name: “email”, “phone_number”, “address.first_name” and “address.last_name” are explicit values. Entering hashed values in these fields will result in Google's side hashing values that have already been hashed, so the match will not work.

@duracelltomi
Copy link
Owner

Thanks for your findings

About for first post: do you have any specific case where this resulted in bad data collection? (I am using this plugin on several ecommerce sites without issues)

About your second finding: Google can detect whether they are getting hashed data or not and prevent the data from being double hashed.

@Tom-nn
Copy link
Author

Tom-nn commented Oct 1, 2024

I have not noticed the negative effects of some numeric values not being a numeric variable. I just noticed that it is not in accordance with Google's specification and I don't know what effects it might have. On the other hand, the lack of coupon and discount limits the possibility of defining events related to it. The fact that somewhere instead of variant should be item_variant, also causes problems in pulling consistent data throughout the purchase path.
Thank you for the information regarding data hashing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants