Why is my TikTok pixel not tracking ads or purchases?

Ribar
Visitor
2 0 2

I am really sick of this problem I am trying to fix this problem sins a month but I can't, my TikTok pixel is not tracking my ads to cart or purchases and when I try to test events it doesn't work either and when I go to my web site to see if the TikTok pixel helper tracking my website right I don't see any results either, and I already got in touch with Shopify and TikTok support but they couldn't help me either.

I will be so grateful if I get any help from you and thanks.

 

( i already checked if I connected my TikTok pixel right and if the pixel is the right one )

my website name: kitchenthingsstore.com

Replies 15 (15)

Mike1974
Excursionist
22 0 2
<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"; 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 || {}; var o = document.createElement("script"); o.type = "text/javascript", o.async = !0, o.src=i + "?sdkid=" + e + "&lib=" + t; var a = document.getElementsByTagName("script")[0]; a.parentNode.insertBefore(o, a) };
	//pixel ID
	ttq.load('YOUR PIXEL HERE ');
}(window, document, 'ttq');

window.addEventListener('DOMContentLoaded', () => {
	{% if  request.page_type == 'product' %}
		ttq.track('ViewContent')
	{% else %}
		ttq.page();
	{% endif %}
	
	document.querySelectorAll('button[name="checkout"]').forEach(btn => {
		btn.addEventListener("click", () => {
			console.log('checkout')
			ttq.track('InitiateCheckout')
		})
	})
})
</script>
DabsDesign
Shopify Partner
44 1 10

This is the only code on the web available that works perfectly, thanks @Mike1974. For those who stop by, enter the code below on your checkout page (shopify-url-store/admin/settings/checkout) to track the complete payment event for 1 or more products:

 

-------------------------------------

 

Esse é o único código na web disponível que funciona perfeitamente, obrigado @Mike1974 . Aproveitando para quem passar por aqui, insira o código abaixo também na sua página de checkout (shopify-url-store/admin/settings/checkout) para acompanhar o evento de pagamento completo de 1 ou mais produtos:

 

<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";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||{};var o=document.createElement("script");o.type="text/javascript",o.async=!0,o.src=i+"?sdkid="+e+"&lib="+t;var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(o,a)};
  ttq.load('YOUR PIXEL ID TIKTOK HERE');
  ttq.page();
  ttq.track('CompletePayment', {
   contents: [
    {% for line_item in line_items %}
    {
      content_id: '{{line_item.product_id}}',
      quantity: {{line_item.quantity}},
      price: {{line_item.line_price | times: 0.01}},
    },
    {% endfor %}],
    value: {{ total_price }} / 100,
    currency: '{{ checkout.currency }}',
}); 
}
(window, document, 'ttq');
</script>

 

DABS Design - Sua Agência Shopify no Brasil. Somos especialistas em Shopify e Shopify Plus, oferecendo consultoria, suporte, criação, integração de Apps e desenvolvimento para sua loja virtual. Conte com uma agência Shopify Expert Partner para potencializar o seu negócio! Entre em contato conosco. Transforme sua loja com os especialistas em Shopify no Brasil!
RHF
Excursionist
24 0 6

im having the same issue..will this code track the View content as well? Also i assume this code has to be entered in the section below the code i have already for my FB?

RHF_0-1662402872543.png

RHF_1-1662402884771.png

 

 

DabsDesign
Shopify Partner
44 1 10

 

 

@RHF Yes, in below your code, BUT I recommend you to use the official TikTok app to Shopify to add your tag: https://apps.shopify.com/tiktok

 

TikTok App Shopify Store (is free)TikTok App Shopify Store (is free)

  

Is very simple to use and works perfectly.

 

TIP: if you want to check everything with your pixel, select to collect the maximum information from your users in TikTok app configurations.

DABS Design - Sua Agência Shopify no Brasil. Somos especialistas em Shopify e Shopify Plus, oferecendo consultoria, suporte, criação, integração de Apps e desenvolvimento para sua loja virtual. Conte com uma agência Shopify Expert Partner para potencializar o seu negócio! Entre em contato conosco. Transforme sua loja com os especialistas em Shopify no Brasil!
RHF
Excursionist
24 0 6

hi,

 

Thanks for the response..my issue is with the tiktok app on shopify its saying that its not connected even though i checked in the shopify app and its connected.. when using the tiktok helper chrome extension it says that there is no pixel ..i had run my first campaign day before adn it spent money fine for a day and then i started getting these errors so im not sure what to do and titktok support has still not got back to me

Levi_SD
Visitor
2 0 0

The code has been applied, still no pixel detected at the url + no attributed events. What would you recommend I try next?

abdoujn
Tourist
3 0 0

can I use this even if I installed the pixel using the Shopify app?

DabsDesign
Shopify Partner
44 1 10

You must use only ONE WAY to enter the TikTok Pixel in your store, if you use more than one way, it will cause duplicate pixel conflict. I suggest using the official app I mentioned in the previous post.

DABS Design - Sua Agência Shopify no Brasil. Somos especialistas em Shopify e Shopify Plus, oferecendo consultoria, suporte, criação, integração de Apps e desenvolvimento para sua loja virtual. Conte com uma agência Shopify Expert Partner para potencializar o seu negócio! Entre em contato conosco. Transforme sua loja com os especialistas em Shopify no Brasil!
abdoujn
Tourist
3 0 0
yes I only use that, and still complete purchase is not tracked properly
!!, I get 400 add to cart when I optimize towards this, but when I optimize
towards complete purchase it drops to 0 or few like 5.
DabsDesign
Shopify Partner
44 1 10

What is the virtual address (URL) of your store?

DABS Design - Sua Agência Shopify no Brasil. Somos especialistas em Shopify e Shopify Plus, oferecendo consultoria, suporte, criação, integração de Apps e desenvolvimento para sua loja virtual. Conte com uma agência Shopify Expert Partner para potencializar o seu negócio! Entre em contato conosco. Transforme sua loja com os especialistas em Shopify no Brasil!
abdoujn
Tourist
3 0 0

https://www.waxingpoetic.com/ is the URL, and thank you very much 

Levi_SD
Visitor
2 0 0

The code has been applied, still no pixel detected at the url + no attributed events. What would you recommend I try next?

 

Soooouheil
Visitor
1 0 0

Hi,

 

did you find a solution for this?

I tried adding the code to the checkout page but still no conversion tracking...

DabsDesign
Shopify Partner
44 1 10

Hi, try to use the official app, works for me:

https://apps.shopify.com/tiktok

DABS Design - Sua Agência Shopify no Brasil. Somos especialistas em Shopify e Shopify Plus, oferecendo consultoria, suporte, criação, integração de Apps e desenvolvimento para sua loja virtual. Conte com uma agência Shopify Expert Partner para potencializar o seu negócio! Entre em contato conosco. Transforme sua loja com os especialistas em Shopify no Brasil!

lance5764
Tourist
3 0 2

did you find a fix, im facing the same problem