• Hello

    I noticed that the created variables are not including the item_id or content_id.
    The Tiktok dynamic catalog advertising requires content_id.

    How can I fix this?

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

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

    (@duracelltomi)

    Hi,

    GTM4WP includes a generic ecommerce data layer that includes product IDs. It needs some transformation in order to use it in tags like in the TikTok pixel.

    For example if you want to track the Add To Cart action, you need to create a Data Layer Variable on the GTM UI and use this variable name:

    ecommerce.items.0.item_id

    Then you can use this GTM variable to send it as the content_id in your TikTok tag with the Add To Cart trigger.

    Thread Starter thegooddealshop

    (@thegooddealshop)

    Like this?
    `<script>
    !function (w, d, t) {
    w.TiktokAnalyticsObject=t;var ttq=w[t]=w[t]||[];ttq.methods=[“page”,”track”,”identify”,”instances”,”debug”,”on”,”off”,”once”,”ready”,”alias”,”group”,”enableCookie”,”disableCookie”],ttq.setAndDefer=function(t,e){t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}};for(var i=0;i<ttq.methods.length;i++)ttq.setAndDefer(ttq,ttq.methods[i]);ttq.instance=function(t){for(var e=ttq._i[t]||[],n=0;n<ttq.methods.length;n++
    )ttq.setAndDefer(e,ttq.methods[n]);return e},ttq.load=function(e,n){var i=”https://analytics.tiktok.com/i18n/pixel/events.js&#8221;;ttq._i=ttq._i||{},ttq._i[e]=[],ttq._i[e]._u=i,ttq._t=ttq._t||{},ttq._t[e]=+new Date,ttq._o=ttq._o||{},ttq._o[e]=n||{};n=document.createElement(“script”);n.type=”text/javascript”,n.async=!0,n.src=i+”?sdkid=”+e+”&lib=”+t;e=document.getElementsByTagName(“script”)[0];e.parentNode.insertBefore(n,e)};

    ttq.instance(‘C93D4LRC77UC6ALA5C30’).track(‘AddToCart’,{
    content_id: ‘{{content_id}}’,
    items: ‘{{Ecommerce Items}}’,
    value: ‘{{Ecommerce Value}}’,
    currency: ‘{{Ecommerce Currency}}’,})
    ttq.page();
    }(window, document, ‘ttq’);
    </script>

    And the data layer is this: https://paste.pics/GKLJF

    Thanks for the guidance

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Missing parameter content_id’ is closed to new replies.