• Resolved diegogaona

    (@diegogaona)


    Hi,
    In my website, the add_to_cart event is not being pushed to the dataLayer. I use the theme JupiterX and made my pages with Elementor, but my cart button, I think is without modification.

    The other events I tested are OK. There is some way to make it work?

    Thanks for the nice plugin, best regards, Diego.

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    @diegogaona Please go to ‘GTM Kit > Help > Support > Share system data with the GTM Kit support team’ and enter the support ticket: FS790-A7A9C

    Thread Starter diegogaona

    (@diegogaona)

    Done!

    Thanks!

    Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    I don’t see any problems on your site, so the next step is debug on your site. I see that you are using a staging environment so it is safe to debug.

    Copy the code from this: https://github.com/tlamedia/gtm-kit/blob/main/src/js/woocommerce.js

    And overwrite the contents on you staging site: /wp-content/plugins/gtm-kit/assets/integration/woocommerce.js

    Clear the cache if you have any.

    Activate the Console log log in ‘GTM Kit > General > Misc > Logging and debugging > Console log

    Go to: /produto/dancar-com-voce/
    Clear the browser cache with Ctrl+F5 or Cmd+R

    Inspect the page and open the browser console. When you choose a product variation there should be som debug info.

    Thread Starter diegogaona

    (@diegogaona)

    I followed the instructions, but I don’t see anything happening in the console after select the products.
    The code still there (if you want to test), the logging and debug is active and I cleared (and deactivated) the cache.

    I saw that when I add to cart:
    WordPress make a POST request:
    https://staging.ateliecatorze.com/produto/dancar-com-voce/?wc-ajax=raven_shopping_cart_single_insert_to_cart

    With this data

    1. formData: attribute_pa_tipo=com-moldura-pinus-a4
    2. quantity: 1
    3. gtmkit_product_data: {“id”:”2443″,”item_id”:”2443″,”item_name”:”Dan\u00e7ar Com Voc\u00ea”,”currency”:”BRL”,”price”:28,”google_business_vertical”:”retail”,”item_category”:”Para casa”,”item_category2″:”quadro”}
    4. add-to-cart: 2443
    5. product_id: 2443
    6. variation_id: 2444
    7. product_id: 2443
    8. product_sku:
    9. quantity: 1
    10. variation_id: 2444
    11. variations: {“attribute_pa_tipo”:”com-moldura-pinus-a4″}
    12. action: raven_shopping_cart_single_insert_to_cart
    13. nonce: 54809d80f2
    14. raven_shopping_cart: exists

    Thanks, Diego

    Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    Something is preventing l.332 from triggering: jQuery(document).on(‘found_variation’

    It might be pagespeed optimization, so could you please try and deactivate any optimization in the LiteSpeed Cache plugin or maybe just deactiva the entire plugin.

    Thread Starter diegogaona

    (@diegogaona)

    Hi Torben,

    Only now I saw that the error only occurs in variations.

    I deactivated Litespeed, and all others not necessary plugins and still don’t work (and after that updated to Woocommerce last version, which showed up today). Maybe is something with the JupiterX Theme (or Elementor, but more probably the theme).

    I will maintain the Litespeed inactive and some others for now.

    Can you test again? If it is nothing to do with your plugin, but is with the theme, can you pass more information about the error (maybe it not only affect your plugin in the future)?
    I will try to contact their support (but I don’t know where you found the error or what causes it).

    Thanks, Diego.

    Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    The problem is that the ‘found_variation’ event is not being registered and triggered: https://github.com/tlamedia/gtm-kit/blob/main/src/js/woocommerce.js#L332

    Since you have deactivated most plugins it is most likely something in the JupiterX Theme that is not compatible.

    I have never experienced this problem before and right now I’m out of ideas about how to solve it.

    Thread Starter diegogaona

    (@diegogaona)

    Thanks Torben!
    I will open a issue with the theme (I don’t have knowledge to solve it) and will make a workaround for now in GTM.

    Thanks for your help.

    Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    Let me know if there is anything i can do to help.

    I’m closing this for now

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘add_to_cart event not working’ is closed to new replies.