-
Notifications
You must be signed in to change notification settings - Fork 95
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 BUG in variable product #339
Comments
I think I've fixed the issue. File: /plugins/duracelltomi-google-tag-manager/dist/js/gtm4wp-woocommerce.js ` ` I have changed from o.id to o.item_id. Now the js script works. Please can you do to check if this solution is valid? |
Thanks for the report and for the suggestion. I will do my best to release this tomorrow |
Great! Thank you |
I have a question: what is "internal_id"? If this field is the product ID (example if we choose to use the SKU value as item_id) we need to fix this field too, because now we send the parent ID when we have a variable product. |
The SKU that is currently being reported is also the wrong one. It picks the parent's SKU, while it should pick the variant's SKU. I think it's best to stay with Google's standards: https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtag#view_item_details item_id: "SKU_12345" Google does not mention an 'id' or 'internal id'. So I guess @duracelltomi can make a definition for those? What are the definitions as currently intended? In woocommerce a variable product (=(parent)product with variants, https://woo.com/document/variable-product/?aff=56839) has: variant/variation product: |
Google documentation does not say you can not add extra keys into the ecommerce items array. In fact, this is how you can define item scoped custom dimensions: https://support.google.com/analytics/answer/14239695 internal_id is needed in some setups to always see the product ID even if you decide to report the SKU in the item_id field. id is there because of a possible miscommunication within Google as in Google Ads they decided to use almost the same event structure as with GA4 but instead of item_id, they are using id to store the product ID: https://support.google.com/google-ads/answer/7305793 So if you want to use the items array to fill both GA4 and Google Ads with product data, both item_id and id needs to be there. If you are not registering the "id' parameter in GA4 as an items scoped custom dimension, it will not harm anything however Google Ads will be able to read the same data and provide dynamic remarketing functionality. I am looking at the SKU issue and reviewing how GTM4WP processes variable and grouped products. |
This should fix all issues: cae6a76 |
Hi everyone,
For variable products there is a big problem in the latest versions of this plugin (1.20.0 and 1.20.1). Version 1.19.1 works.
When we have the variable product, the plugin do a strange merge of the fields and send principally the fields of the product root/parent.
This is the current DataLayer (wrong):
My correct data are:
The ID variation: 9255
The ID parent: 4269
The variant: "quantita-250-ml"
This bug has already been reported several times, but has not been fixed. It has been present for about a month.
The text was updated successfully, but these errors were encountered: