
February 28, 2023
How to reuse GA4 ecommerce data in Tiktok Pixel
This will be a short blog post (because all the necessary things are covered in the video below). But I hope to find more time in the future and turn this into a wholesome article.
This blog post presumes that you have already installed Tiktok Pixel with Google Tag Manager. If you haven’t done that, watch this tutorial first.

Video: Reuse GA4 e-commerce data in Tiktok Pixel
In the video below, I am using Google Tag Manager to do that.
At one point in the video, I will mention a JavaScript code that you need to use in a Custom JavaScript variable. Here it is:
function(){ var ec = INSERT_YOUR_ECOMMERCE_VARIABLE_HERE; var ecItems = ec.items return ecItems.map(function(product){ return { "content_id" : !!product.item_id ? product.item_id.toString() : undefined, "price" : !!product.price ? parseFloat(product.price) : undefined, "quantity" : !!product.quantity ? parseInt(product.quantity) : undefined, "content_name" : !!product.item_name ? product.item_name.toString() : undefined, "content_type" : "product" } }) }
Make sure you create a Data Layer variable accessing the ecommerce object (version 1). Then replace the INSERT_YOUR_ECOMMERCE_VARIABLE_HERE part with that variable.
This variable will take all products that are available in the data layer (ecommerce.items) and then outputs the format supported by the Tiktok Pixel.
Final words
Also, don’t forget to use Tag Sequencing and make sure that your Pixel base tag (implemented with a Custom HTML tag) fires before the event tag.
But the base code does not “like” when it fires multiple times, these your Custom HTML tag should be set to fire only once per page.

7 COMMENTS
Hi Julius, I've followed your advice however I'm getting issue reported in TikTok debug.
"The content type for one or more of your events is invalid. Content type must be either "product" or "product_group"."
This is happening for initiate checkout and purchase events when i have Multiple Contents selected. Is it not automatically set to be product group?
Hi, I just updated to include content_type : product.
Check if that works/helps
Hi Julius,
Yes this helped! Wasn't sure if i should use product_group or product. This works!
Thank you.
I just hardcoded the value "product" because that's what is usually used by most companies :)
Hi Julius,
thank you for the manual, it really helped.
I just have one question. While using the tag from gallery where I select enhanced ecommerce I do have issue with the currency. The TikTok pixels shows USD even if in eec object is different currency. Is there a way to fix that?
Thank you in advance.
Hi Julius,
as far as i can see tiktok has now added the possibility to use custom events.
can you please add the topic in this article?
thx
julian
Hi, I followed your guide but the tik tok browser and client event tags do not activate and in the tag firing it says "exception thrown", what does it mean? The pixel helper does not find them. I configured the pixel with custom htm with the tag thrown once per page trigger all pages, that is detected and tracked correctly, I selected that the tag events must be activated only after the tik tok pixel, but nothing, the events in "limited exception" are always thrown; I could not find the tag error even in your guide to generate tags that are not thrown. Can you help me?