• larixes

    (@larixes)


    Hi Tomi,

    At first, I really congratulate you for this plugin. I found out one thing that impedes me from having great Enhanced E-commerce Analytics. I have a problem with Variable Products. Event DetailView only fired when I choose the variant option on a product page, so I don’t have information that someone has been on this page without choosing the variant. I wonder if I can send DetailView without variant options when a user enters the product page and fire event AddToCart with Product with chosen variant options. (Without firing DetailView event every time a user changes the variants). Could you tell me what part of the code is responsible for that that I could make some changes?

    Thanks a lot ??
    Chris

    • This topic was modified 7 years ago by larixes.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi Chris,

    This is a great question.
    The main problem and my concern here is that on a variable product page, the ID of the product changes in the ecommerce flow: while showing the product on a category page, only the main product’s ID can be added. While on the detail page, no product detail event is being sent as in that case I do not see any benefit:

    The add to cart event will be fired using the product ID of the product variation and every later ecommerce action will use this new product ID.

    What would you do with a detail event with the root/main product ID?

    Thread Starter larixes

    (@larixes)

    Hi Tomi,

    Thanks for your reply ??
    I just realised that there are the different ID for different variations that’s why I use your option to use SKU instead of ID. Thanks to this every variation has the same ID now in Enhanced Ecommerce. I explain to you what I need to see in my Google Analtyics:

    1. Product Impression on category page – works perfectly!
    2. Product Click – what product has been clicked on category page – no data
    3. Product details – what product page has been visited by the user (doesn’t matter what variation has been chosen – I only need to know what was the product) – no data
    4. AddToCart – What product variation has been added to cart – works perfect!

    Have you got any idea how to manage this? ??

    Thanks,
    Chris

    Thread Starter larixes

    (@larixes)

    Hi Tomi,

    I just found and DataLayer example what I mean. It is on website: https://enhancedecommerce.appspot.com/

    If you enter the product page to the dataLayer there are those data send:
    “ecommerce”: {
    “detail”: {
    “products”: [
    {
    “id”: “f6be8”,
    “name”: “Comverges T-Shirt”,
    “price”: “33.00”,
    “brand”: “Comverges”,
    “category”: “T-Shirts”,
    “position”: 0
    }
    ]
    },

    – as you can see there is no variant options, but If I click to add this product to the cart this data is pushed to dataLayer:

    “event”: “addToCart”,
    “ecommerce”: {
    “currencyCode”: “USD”,
    “add”: {
    “products”: [
    {
    “id”: “f6be8”,
    “name”: “Comverges T-Shirt”,
    “price”: “33.00”,
    “brand”: “Comverges”,
    “category”: “T-Shirts”,
    “variant”: “red”,
    “dimension1”: “M”,
    “position”: 0,
    “quantity”: 1
    }
    ]
    }
    },

    – this time with variant and some aditional dimensions ??
    Can you give me some clues how I can edit your plugin to achive it.

    Thanks ??

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi,

    Currently you can add this by modifying the GTM4WP plugin itself.
    The codebase for v1.8 has been finalized and currently tested so that the new version can be released soon.

    I can include this change in v1.9 but I do not have currently any ETA for that version.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Variable Product in DataLayer DetailView’ is closed to new replies.