Skip to main content
Contributor II
November 28, 2023
Solved

GTM 'Viewed Product' Works on Debug Only

  • November 28, 2023
  • 5 replies
  • 216 views

Hello!

We have a custom integration that we are attempting to plug Klaviyo into. We are using GTM for this. We’ve been able to get ‘viewed product’ to fire but only on GTM Debugger
 

Site is made in Next JS & Azure

Here is our viewed product snippet

<!-- Klaviyo Viewed Product Script -->
<script type="text/javascript">
  var item = {
    "ProductName":document.querySelector('.ProductComponent_productName__2AuMo').innerText,
     "SKU": document.querySelector('.ProductComponent_productInfoRow__5FcoG h4').innerText,
        "ImageURL": document.querySelector('.Slider_sliderImage__iRN_K').getAttribute('src'),
    "URL": window.location.href,
     "Price": document.querySelector('.Price_priceLarge__2OtPj').innerText.replace('$', ''),  // Removing the dollar sign from the price
      };
  klaviyo.push(["track", "Viewed Product", item]);
</script>


We have changed the trigger a few times seeing if this was the issue. We tried, DOM Load, /product page view, etc

    This topic has been closed for replies.
    Best answer by Brian Turcotte

    Hi @OSItalia and @PWMKTG_Team!

    My apologies for the delay here! I’ve been informed that this should be resolved - is the issue still occuring for you?

     

    - Brian

    5 replies

    Brian Turcotte
    Klaviyo Alum
    December 1, 2023

    Hi @PWMKTG_Team!

    I’m going to check on this with Engineering and I’ll get back to you ASAP!

    Best,
    Brian

    Contributor II
    December 5, 2023

    Hi @PWMKTG_Team!

    I’m going to check on this with Engineering and I’ll get back to you ASAP!

    Best,
    Brian

    Hello Brian,

    Could cookie settings be preventing this?
    Here’s what I get when I use browser tools to look at these scripts-


    In a future version of the browser, cookies marked with SameSite=None; Secure and not Partitioned will be blocked in cross-site requests. This behavior protects user data from cross-site tracking.

    kl_csrftoken .klaviyo.com/
    kl_sessionid .klaviyo.com/
    OSItalia
    Contributor I
    Contributor I
    February 5, 2024

     

    Hello Brian, we have the same issue

     

    1. Reading cookie in cross-site context will be blocked in future Chrome versions

      1. Cookies with the SameSite=None; Secure and not Partitioned attributes that operate in cross-site contexts are third-party cookies. In future Chrome versions, reading third-party cookies will be blocked. This behavior protects user data from cross-site tracking.

        Please refer to the article linked to learn more about preparing your site to avoid potential breakage.

      2. RISORSE INTERESSATE
        1. 3 cookie

          1. Nome Dominio & Percorso
            kl_csrftoken .klaviyo.com/
            _ga .klaviyo.com/
            _ga_E2RS7HT946 .klaviyo.com/
        2. 2 richieste

          1.  klaviyo.js?company_id=T6uyTf&ver=3.3.3
             klaviyo.js?company_id=T6uyTf
    Brian Turcotte
    Klaviyo Alum
    April 25, 2024

    Hi @OSItalia and @PWMKTG_Team!

    My apologies for the delay here! I’ve been informed that this should be resolved - is the issue still occuring for you?

     

    - Brian

    Brian Turcotte
    Klaviyo Alum
    April 25, 2024

    Hi @OSItalia and @PWMKTG_Team!

    My apologies for the delay here! I’ve been informed that this should be resolved - is the issue still occuring for you?

     

    - Brian