Undefined value for email | Tik Tok Pixel web and server


I’m trying to setup TikTok Pixel both web and server.
For server I’m using Stape template and for web, since I didn’t find a full step-by-step guide, I ended up using a template that I found seeing an YT video.

I’m far far away from making this work, but I had to give a try.
At this point I’m stuck because I don’t understand why I’m not getting the email param for Addtocart, but I’m getting it for InitiateCheckout.

Please see below:

Web - TT Add to cart Tag

Web - TT Initiate Checkout Tag

Web - Tag fired Add to cart

Web - Tag fired Initiate Checkout

Server - TT Add to cart Tag

Server - TT Initiate Checkout Tag

Server - Event data Add to cart

Server - Event Data Initiate Checkout

Server - Tag Fired Add to cart

Server - Tag Fired Initiate Checkout

Any idea where to check?

You didn’t add screenshots of the tags that send the data to the server. It could be GA4 or Data tag, depending on what you use.
Most likely these tags just don’t have an email in them.

Thanks, Alex.
Meanwhile (doing some more tests in weekend) I managed to find where was the mistake.
ATC Tag in web container didn’t have email param.
All good now (at least for this tag).

But I’m still having problems with the setup.

I’m not sure how to format content_id/contents in order for TT to be happy with the info.
Also, content_type it’s an issue. Even if i set the param “product”, it doesn’t work.

Here you can find all variable formats including contents: TikTok API for Business

Yeah, I red the documentation… but I’m not a dev, so it’s hard for me to work with code.

For web I’m using this template - How To Install TikTok Pixel Tracking On Your Website (Using GTM) - YouTube - since I couldn’t find any other option. And as I said, I’m not a dev to work directly with code.
Do you have any recommendation? There is another template in GTM Gallery that I could use? Or any other solution?

For API I’m using stape template, all good here.

Many thanks!


As your most recent screenshot outlines - your contents parameter is missing a content_type property, you should add it to whichever tag does web–>server hit, then pick it up on the server and send along with events.

See below, you’re grabbing ‘items’ and push it as content, your ‘items’ is missing content_type as described above. Either add content_type to your ‘items’ or pass a separate parameter altogether.

Hello, Dan.

Thanks for your reply.
I’ll try to follow your instructions and test.
Also, i will contact the team who have the template, I think there are some bugs.

Looking on stape blog and community, looks like there isn’t a step-by-step guide for installing TT pixel both on web and server, am I right?

Hello again, @Dan .

The web template is bugged - that’s for sure, I talked to the team.
So, since I didn’t find another web template, I ended up installing pixel using code.
All good here. Here is Place an Order screen shoot from Pixel Helper.

So, I managed to solve half of the problem. :slight_smile:

But I’m not sure why content_type isn’t pass to server. Already double checked Event Data from server and there is nothing there.

In TT Test events, i can see this.

One problem is related to content_type and one problem related how ‘contents’ is formatted.

Here is my Event Data from server.

In web, I managed to extract only IDs and Names using a Custom JS Variable. (I did like that because of this "“Use contents when you have multiple content IDs. If you use contents in your parameter, you must also include the following in a sub-object: the product id or ids, and the quantity (number of items added to cart or purchased)”

Should I do the same in server, to extract IDs and Names? But what should I do with these since I have only Contents in the template.

In case you need it, here is the Place an Order tag from web.

I hope i was quite coherent. :slight_smile: If you need more screenshots, I can provide.


Hi @Alin_Tatarca

Yeah, there are no proper web templates for TikTok as of yet, we have one planned but there’s so much other stuff going on :slight_smile:

Long story short - you have to pass proper parameter to the server, one containing all the stuff that TikTok needs. Since you rely on GA4 items (as far as I can tell) I suggest you use this template on the web:

just feed it your items array, pick the correct setting and it will form ‘contents’ array which you need to pass to the server.

Good luck and have fun


1 Like

I will definitely try this! Thanks, @Dan !

But I must admit that I’m embarrassed a little for not knowing how to “use” your link. :slight_smile:
I mean I know how to import a template, but downloading .tpl file from Github and trying to import in GTM web gives me “Error importing file”.
(since it’s a variable, I tried to add a new Template variable)

I’m pretty sure that I’m doing something wrong…

Hey @Alin_Tatarca

Just try again, might be a lag or something. I just successfully added this template to a container.

Make sure it’s the web container you’re trying it on, make sure it’s variable template, make sure you refresh GTM beforehand (to avoid stale data thing)

Hi, @Dan

All good with Conversions Variable - it’s exactly what I need for TT. Many many thanks!

Since GA4 can’t send array from web to server, I’m gonna use Data Tag/Data Client.
But I have a question. Do you think that it’s a problem that for e.g Initiate Checkout will be claimed by both GA4 and Data Client?
Will this affect data somehow?

you can limit your triggers (server-side) by client name, or have one of the tags send a different event_name. leaving it as is - not an option, you’ll be reporting events twice each time.

I’m taking small steps, @Dan. :slight_smile:
And I feel I’m pretty close to solve this with your help.

Testing how to limit the triggers (server-side), I noticed a more important thing - that TT is not happy with “contents”.

Everything looks normal to me. (Exemple is for View Content)

I used Universal Conversions Variable to format “contents” web side.

And I got this.

I used Data Tag to send info from web to server.

And this is the error.

Also, this looks normal.

What do you think?


Hello, @Dan,

One more thing that I tried was to use makeString on lines 185 and 186 but with no success.

I got the same error message as in previous reply.

you have to add the API to the template, I don’t believe it’s there currently

You need to be tweaking the makeString in UCV template, not TikTok.

1 Like

Thank you, @Dan!
It works :slight_smile: I’ll continue with the setup.

Everything looks normal both on web and server for pixel TT.
I hope it will stay this way :slight_smile:

If someone reads this, please note that the error from Pixel Helper saying that “event_id” is not a string it’s just a bug - I talked to the team and they said that I should ignore that.

Thanks again, @Dan, for your help.