Support » Plugin: Google Tag Manager for WordPress » Problem with click event listener on product links

  • Resolved jakoblieser

    (@jakoblieser)


    Hi,
    I have a complicated bug.
    Problem:
    If you visit a product from the product list / archive view and go back the link click on that product doesn´t do anything. This only happens on mobile devices, I tested Safari and Chrome on ios.

    My testing
    The error only occurs on real mobile devices (dev tools responsive mode everything works fine) and with browser caching enabled. A GTM Container has to be loaded either via gtm4wp or borlabs. I think the event listener causing problems is added in gtm4wp-woocommerce-enhanced.js?ver=1.13.1 at the part with the comment
    // track clicks in product lists

    When deactivating this event listener via the safari dev tools with a real mobile device connected the link works fine on the second click. I am stuck at this point and hope you can help me. I can provide access to a stagging site where the error can be tested.

    Plugins / Themes
    This occurs with latest version of oceanwp / twenty twenty one. Only Plugins active were gtm4wp and woocommerce, both newest version.

    At the beging of my debugging I thought this is a special error from my setup but on the staging site I narrowed it down to only gtm4wp and woocommerce active and the standard theme. Also tested it on another site. Therefore I think this might be an issue wich affects multiple sites but goes easily unnoticed because you can´t test every possible device/browser etc. combination.

    I am curious what you will find out.

    Thanks!
    Jakob

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter jakoblieser

    (@jakoblieser)

    Hi,
    is anyone else having this problem?
    @duracelltomi could you reproduce this behavior?

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi,

    If you have a dev site, could you test this beta version?

    https://github.com/duracelltomi/gtm4wp/releases/tag/1.14beta3

    It includes some fixes for Safari that is related to your issue as well.

    Thread Starter jakoblieser

    (@jakoblieser)

    Hi Thomas,
    I tested the beta on my dev site and it seems to fix my error. When do you plan to release the version 1.14?
    Thank you very much!

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi,

    My plan is the 1st days of December.

    v1.14 also replaces lots of jQuery dependency in JavaScript codes. Could you go through all ecommerce events? Most of them are now tracked using an updated valina JavaScript, I wonder if it breaks at any point in your case?

    Thread Starter jakoblieser

    (@jakoblieser)

    Hi Thomas,
    Events seem to work fine. I discovered a new problem that is caused by GTM4WP. It is similar to my first problem.

    If you visit a product from the woocommerce product archive page and go back via the browser back button the scroll position is lost. For a short moment its right and then the page jumps back to the top.

    I did a lot of testing again and occurs mobile in safari and chrome. I also tested it with the standard theme and only Woocommerce and GTM4WP active. If you block this script everything works fine: gtm4wp-woocommerce-enhanced.js

    If you deactivate the device cache via the safari dev tools and a connected phone it works fine.

    I hope this information is enough for you to debug this issue. I think this could be an issue for every site using GTM4WP.

    Get in contact with me if you need access to my staging site.

    Thanks!
    Jakob

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi Jakob,

    There is (was?) an issue in Safari when using the back button on product pages.
    Things broke after getting back to the previous page. Therefore in Safari, the page is forced to reload if using the back button.

    This might cause this behavior.

    I am open to retest this without the reload if you have a test/dev version of your site.

    Thread Starter jakoblieser

    (@jakoblieser)

    Hi Thomas,
    this behavior is also in chrome on mobile. Is the forced reload only for safari?

    Where can I send you credentials for the dev site?

    Thanks
    Jakob

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Chrome on mobile, both on Android and iOS?

    Thread Starter jakoblieser

    (@jakoblieser)

    Chrome on mobile on iOS. I have no Android device to test it there

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Chrome on iOS is forced to use WebKit thus it should produce the same behavior as Safari.

    Credentials: per WP forum guidelines, I am not allowed to request or accept such information, it could lead to the termination of the plugin repository.

    If you only would like to send me the URL of the dev site privately, please use the Messenger on the Facebook Page of GTM4WP

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.