managed-components/tiktok

Ability to send all needed parameters

Closed this issue · 4 comments

We are only able to add the phone and email as fields in the TikTok Tool and it would be awesome if we could add more.

Here is the comparison between what is sent currently and what should be able to be sent according to the TikTok docs:

This is what is currently being sent:
{ "pixel_code":"XXXX", "event":"ViewContent", "event_id":"14335566851790004", "timestamp":"2023-05-10T08:08:34.000Z", "context":{ "page":{ "url":"https://example.com/?ttclid=11111"}, "user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36","ip":"xx.xx.xx.xxx", "user":{ }, "ad":{ "callback":"11111" } }, "properties":{ }, "test_event_code":"TESTXXX" }

And this is all the fields that we need to be able to send:
--data-raw '{ "pixel_code": "BU35TSQHT2A1QT375GMG", "event": "InitiateCheckout", "event_id":"1616318632825_357", "timestamp": "2020-09-17T19:49:27Z", "context": { "ad": { "callback": "123ATXSfe" }, "page": { "url": "http://demo.mywebsite.com/purchase", "referrer": "http://demo.mywebsite.com" }, "user": { "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", "ttp":"94e2a4j9-h3j5-k2h5-98cc-c84a745mk098" }, "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 Safari/537.36", "ip": "13.57.97.131" }, "properties": { "contents": [ { "price": 8, "quantity": 2, "content_type": "product_group", "content_id": "1077218" }, { "price": 30, "quantity": 1, "content_type": "product_group", "content_id": "1197218" } ], "currency": "USD", "value": 46.00 } }

The key improvements that need to be made in my opinion are:

  1. The ability to access/set the "event_id" from the client so we can deduplicate events.
  2. Be able to send the "external_id" and "ttp" user parameters from the CloudFlare interface.
  3. Be able to send the "contents properties" which include the content_type, content_id etc.
bjesus commented

It seems like this information is mostly Ecommerce information and can be sent using the Ecommerce API, or am I missing something?

For parameters like external_id, ttp etc - again we need to know that the component knows how to handle them before adding them to the UI, otherwise people will try to use them but it will not work.

@bjesus, thanks very much for getting back to me. I have submitted a pull request that adds the ttp parameter. The external_id parameter was already handled. I believe you should be able to add these fields to the TikTok Tool interface now.

Also, I have submitted a pull request to have the ability to set the event_id from the CF interface/client so deduplication can occur if needed.

Already merged

@kuba-orlik, when looking in the zaraz interface in Cloudflare, I still can't see the ability to add the event_id, so that I can deduplicate events from the server side and client side, like we can do with Facebook.
Screenshot 2024-01-22 at 8 01 32 pm