• Resolved JawaScript

    (@crimsonguard)


    Hi
    On Firefox, I see a strange behavior on WooCommerce products links when GTM4WP is enabled.
    >> Nothing happens when I click those links.
    No problem on Chrome and Edge.

    When inspecting the page, I can see a span with class “gtm4wp_productdata” below each product.
    Removing the span makes the link clickable again.
    Disabling GTM4WP makes the links clickable also.

    Please advise.
    Thank you for your work.

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

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

    (@duracelltomi)

    Hi,

    Could you test a change in the code of GTM4WP?
    In the “js” folder where is a file: gtm4wp-woocommerce-enhanced.js
    Line 767 should look like this:

    'eventCallback': function( container_id ) {
    				if (window.gtm4wp_first_container_id != container_id) {
    					// only call this for the first loaded container
    					return true;
    				}

    Could you change it to this:

    'eventCallback': function( container_id ) {
    				if ( "undefined" !== typeof container_id && window.gtm4wp_first_container_id != container_id) {
    					// only call this for the first loaded container
    					return true;
    				}

    It would be best if you could do this first on a dev/test version of the site.

    Thread Starter JawaScript

    (@crimsonguard)

    yes, it works.
    Will this be added to next plugin update, or will I have to repeat this fix on each future update?
    Thank you very much.

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Thread Starter JawaScript

    (@crimsonguard)

    Ok great, thank you

    Thread Starter JawaScript

    (@crimsonguard)

    Hello Thomas
    We noticed that the problem was still present on some conditions.
    We see it on Firefox and Edge (sometimes on Chrome) for related products row.
    Example page is …/produit/bureau-yale/ (domain is hidden on my original post).
    Thank you

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi,

    There is a 3rd party script loaded on your page:
    https://www.snrcdn.net/sdk/3.0/synerise-javascript-sdk.min.js

    It seems to reset the dataLayer variable, disconnecting it from GTM after page load.
    If I block this script to be loaded, related products work.

    Thread Starter JawaScript

    (@crimsonguard)

    Thank you very much, the authors of synerize script did find the issue and fixed it.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Click issue on WC products (Firefox only)’ is closed to new replies.