Agnostic Purchase Event

Hi there zaraz community, I'm trying to understand how the Web API part of Zaraz could be utilised. I've inspected the code of the managed components, and it seems like the payload should be matched exactly to the integration. What exactly is the reasoning behind using Zaraz then in terms of server side? Why wouldn't I just make API calls to the native integrations from Meta (Graph API), TikTok Events API themselves? For example, my webhook is making a call to the Zaraz WebAPI route, but this payload is only consistent with Meta Conversions API. I want to add GA4 + TikTok, etc. But does this mean I have to dive into the docs of all those and construct those payload bodies myself? I've inspected the TikTok managed component, the schema is configured as "email, phone" and not em. TikTok also provides a Payload Converter API that enables you to POST your pixel payload and they will convert it for you. How can I use Zaraz with just 1 body and have it figure out the payload for the 3rd party tool? Thanks
No description
9 Replies
Wraith
Wraith•13mo ago
Starting a thread here, this is a good question. (Also why are there no examples? 🤔)
ItsTobias
ItsTobias•13mo ago
Zaraz does the mapping itself for e-commerce events. But can't do other event types. From my point of view the main benefit for the API interaction is for sending details to those services from events generated serverside. For example a purchase is made we send the event directly to Zaraz rather than having the users browser relay it for us. You can map event properties from your Zaraz event to the values required for each third party provider within the Zaraz tool So you can construct a set of event properties on your server that will work for all the events you want to trigger on the various third parties. You have to build the mapping yourself though if it's a non standard event. This takes 30 seconds and is a one time thing though so it's not really a major drawback is it?
Mackenly
Mackenly•13mo ago
Are you referring to the Web API (docs) or the HTTP Events API (docs and what your screenshot show)? The Web API is much like the GTM datalayer client-side calls. Like GTM, the data you pass in is integration-specific and sometimes requires different formatting depending on what the tool desires. The HTTP Events API is a lower funnel thing that's typically used to provide a generic API for interacting with vendor/tool CAPI integrations (rather than sending data directly to Meta or Tiktok as you described, you can send it to Zaraz and multiple tools can subscribe to and use that one track call rather than you manually implementing all those calls). This makes sense for sending events that occur outside your website or within your backend. The Web API is the preferred method when a user is actively interacting with your website, because the request context can be used and information about the user's request can be used by the tool. The HTTP Events API makes sense if you have a manual sales process and want to send events from your CRM, or if there's other non-website interactions or conversions you want to measure.
Wraith
Wraith•13mo ago
Just more information around an agnostic payload and how it operates with other integrations the integrations seem like a big black box purchase events for example dont goto google ads
Unknown User
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
SpecOpsJosh
SpecOpsJoshOP•13mo ago
Hello, as I didn't clearly mention this. There are API calls made from my webhook to the Zaraz HTTP Events API. This in order to perform full server side tracking. I also use the custom triggers and actions for web-based evens, albeit a bit less. I find myself mostly using the Events API to push events to Meta and other sources. So how exactly would it work to push this agnostic event? This might be true. But is it that you have to create the custom triggers in the zaraz dashboard and then push 1 single payload that distributes them along the other sources? So in essence, if I push the Meta Conversions API payload, I require an extra action where i define all the other parameter names for (e.g.) tikok. so: em: email, etc. etc. Because when you push an http event api with the key email, zaraz won't internally convert it to em for Meta. Maybe I just misunderstood, because I was under the impression that the events api was also able to route all the custom payloads to integrations accordingly using "All Tracks" without specifying these custom parameters in the dashboard. It is not necessarily a dealbreaker but a bit inconvenient and unexpected considering some native approaches already mirror the Meta Conversions API event body in their own pixels. Such as the tiktok payload conversion api Furthermore, inspecting the code of the managed components also seems to show that, in fact, that is exactly what it does. It copies the payload, hashes accordingly (that's nice), and then pushes it to the provider. But I can't seem to find any mappings of variable names, etc. So these have to be created manually? Furthermore, the CreateRegistration event does not even exist in Google Analytics. So while I've been pushing them I noticed last week that there were no signups in my GA4 audience because this event does not exist. It is called sign_up , but this mapping is not performed
SpecOpsJosh
SpecOpsJoshOP•13mo ago
When you do this, the event will get registered I guess, but now the normal properties will be added so you have to match the payload for the API from google. so now the payload will be less dynamic since you'll have to create fields for every variable i guess?
No description
Wraith
Wraith•13mo ago
Yeah some pragmatic setup for common situations involving ga4 gads etc for typical things like purchases and signups i think more docs is the right answer
SpecOpsJosh
SpecOpsJoshOP•12mo ago
Thanks for your explanation. What I don't understand is that you have to create the mapping yourself if it's a non-standard event. The Purchase, CompleteRegistration, etc. are all standard events in almost all providers. The TikTok Events API almost completely mirrors the Meta Events API. Also the reason i brought this up is for example that tiktok themselves provide a payload converter for meta events that will automate the mappings for you (https://ads.tiktok.com/help/article/about-events-api-payload-converter?lang=en) -- so in this regard, Zaraz would actually be even worse to use rather than push your data manually (if I understand correctly). I mean if we have to create custom actions to do the mappings that is fine, but is that what we have to do? then we'll just create a bunch of actions i guess.

Did you find this page helpful?