Home Forums WoodMart support forum Product thumbnail arrows stop working when Google Tag Manager / GTM4WP is active

Product thumbnail arrows stop working when Google Tag Manager / GTM4WP is active

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #691655

    x7corp
    Participant

    Hi Woodmart team,

    I’ve identified a conflict between Woodmart’s product thumbnail gallery scroll and Google Tag Manager (GTM) when using the GTM4WP plugin – e-commerce tracking.

    Issue summary

    On shop archive pages, the thumbnail arrows (< >) on product images do not work correctly when GTM4WP’s Enhanced E-commerce → “Track e-commerce” option is enabled.

    Instead of scrolling through thumbnails, clicking the arrows immediately opens the product page.

    When “Track e-commerce” is disabled (or when a fake GTM ID is used), the arrows work normally.

    What I’ve tested

    • All other plugins disabled → same behaviour.
    • Paused all tags inside GTM → still happens.
    • Switching to a fake GTM ID or disabling Track e-commerce → problem disappears.
    • No related JavaScript errors in console.

    Thank you for checking this.

    #691778

    Artem Temos
    Keymaster

    Hello,

    To solve this issue, you need to copy the product hover file from the parent theme located at woodmart/woocommerce/content-product-buttons-on-hover.php to the child theme using the same path. Then, in that file, add the class quick-view-button to the link with the class product-image-linkhttps://monosnap.ai/file/w1oWIkMXQGxdFtEm7641Bydq7JqJVi

    Kind Regards

    #692031

    x7corp
    Participant

    To confirm, I must replace line 11 with:

    <a href="<?php echo esc_url( get_permalink() ); ?>" class="product-image-link quick-view-button" tabindex="-1" aria-label="<?php echo esc_attr( get_the_title() ); ?>">

    #692044

    Artem Temos
    Keymaster

    Yes, it is correct. Please apply the changes and let me know if it helps.

    #692089

    x7corp
    Participant

    Yes, the fix works fine, thanks.

    The only note is that this approach sacrifices the select_item event being recorded in GTM when users click on the product image to open the product page. Apart from that, everything else functions perfectly, and the thumbnail arrows now work across all browsers.

    #692147

    Artem Temos
    Keymaster

    Great, we are glad that you sorted it out. Feel free to contact us if you have any further questions.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Product thumbnail arrows stop working when Google Tag Manager / GTM4WP is active’ is closed to new replies.