tiktok / gtm-template-pixel

Apache License 2.0
12 stars 1 forks source link

Warning - content ID received with no value #1

Closed agenciaregex closed 1 year ago

agenciaregex commented 1 year ago

Hi everyone! Using this template, I tryed to set the viewcontent event: Print_ 2022 11 17_12

But I am receiving warning that the content ID received has no value: Print_ 2022 11 17_13

Details of the configuration tag: Print_ 2022 11 17_14

func - get products - viewcontent TikTok `function(){

var variants = {{JS - LS.variants}}; var product = {};

if (variants.length > 0){

var products = [];  

for (i=0;i<variants.length;i++){
    product= {
      content_id: variants[i].id,
      content_type: 'product',
      content_name: {{JS - LS.product.name}},
      price: variants[i].price_number,
    };
    products.push(product);
}
return products;

} } `

Someone know how to solve this issue? Best regards, Samuel.

shiwei-tiktok commented 1 year ago

Hi Samuel,

To help us replicate this issue - could you share 2 things.

  1. The JSON Data Layer structure of {{JS - LS.variants}} and
  2. What data layer option are you using?

Best. Shi Wei

agenciaregex commented 1 year ago

Shi Wei, ni hao ma?

For sure. I am sending the information requested.

  1. Follow the variable: Print_ 2022 11 18_01

and the structure (if you prefer, can check more detais on your PC https://lojaregex.lojavirtualnuvem.com.br/): image

image

  1. LS.variants

The point is that: if I use the HTML structure on GTM to build the viewcontent event, it shows all the parameters with no error (including content ID). But when I use the GTM TikTok template, appear such error. Even using the same variable/function (func - get products - viewcontent TikTok).

If need any other information, don't hesitate to contact me.

Regards, Samuel.

eddie-tiktok commented 1 year ago

Hi @agenciaregex , we pushed a fix. Can you try the latest template?

agenciaregex commented 1 year ago

Hi @eddie-tiktok, now the problem was solved. Thank you! Regards, Samuel.