Server-Side Tagging
Rokt Ads clients set up for server-side tagging via Google Tag Manager can leverage Rokt's Event API to integrate conversion data in real-time.
Server-side tagging is only applicable to advertisers for the purpose of conversion reporting due to its decoupling from the front-end application
Identifiers for Conversion Reporting
Advertisers are strongly recommended to use a persistent identifiers (e.g. email or hashed email values) to close the loop. Persistent identifiers allow Rokt to more accurately attribute conversions back to the original referral events across channels and over time.
However, should you require PII-less conversion reporting, please speak to your account manager about using the Rokt ID as an identifier.
Recommended Integration Approach
Reporting conversions using the Event API from a server-side container involves the following steps, which map to the numbers in the diagram above.
Steps 1 and 2 below assume that an identifier necessary for attribution must first be passed from the client-side app to the server-side container. If an identifer already exists server-side, you can skip these steps.
[ Client-side ] Persist the identifier of choice through to the conversion events.
- The identifier (e.g. email, Rokt ID) can be persisted by pushing its value to the client-side dataLayer on the landing page.
- Then, upon each conversion, incorporate the value as a GA4 Event parameter to then be sent towards your server-side container.
[ Client → Server ] Upon conversion, send the identifier to your server container via a GA4 Event.
- The trigger rule for the GA4 Event should be tied to the conversion event.
[ Server-side ] Claim the RTID-containing request with a GA4 Client.
[ Server-side ] Based on the incoming GA4 event name, conditionally fire an HTTP Request Tag to send a POST request toward Rokt’s Event API endpoint (https://api.rokt.com/v2/events). Reference the Event API documentation for details on how to authenticate and interface with the API, including how to construct a valid payload.
- Ensure to include a
metaData
object with key/value pairs:{ "name": "source", "value": "sgtm" }
- If request is successful, the tag should receive back a
200
response with the body:{"data":{"unprocessedRecords":[]}}
- Ensure to include a
As part of the QA process, your account manager will verify that all conversions have been received correctly by Rokt.
Conversion Reporting API
For use cases that do not involve PII of any kind, Rokt also exposes a GET endpoint (https://apps.rokt.com/api/conv
) for conversion reporting, which expects the below query parameters. When possible, Event API should be preferred due to its security and flexibility over the Conversion Reporting API.
Parameter | Definition | Required | Example |
---|---|---|---|
id | Your Rokt account ID | True | 3051387316918867566 |
passbackconversiontrackingid | 32-character ID used for PII-less conversion reporting | True | qjkp3xy7dtf9wvneazc5r2bh8ls1m06g |
conversiontype | A string to differentiate between different conversion events | Optional (unless reporting multiple events) | signup, purchase, freetrial |