Skip to main content

Server-Side Tagging

If your organization is set up for server-side tagging via Google Tag Manager, you can leverage Rokt's postback endpoint to report conversions.

Use Case Limitations

Server-side tagging is only applicable to advertisers for the purpose of conversion reporting due to its decoupling from the front-end application

Postback Endpoint

Rokt exposes a secure endpoint (https://apps.rokt.com/api/conv) for conversion reporting, which expects the following query parameters:

ParameterDefinitionRequiredExample
idYour Rokt account IDTrue3051387316918867566
passbackconversiontrackingid32-character ID used for PII-less conversion reportingTrueqjkp3xy7dtf9wvneazc5r2bh8ls1m06g
conversiontypeA string to differentiate between different conversion eventsOptional (unless reporting multiple events)signup, purchase, freetrial

sGTM integration swimlanes diagram

Closing the loop in a PII-less way using RoktTransactionId (RTID) involves the following steps, which map to the numbers in the image above.

  1. [ Client-side ] Persist RTID through to user conversion events.

    • RTID 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.
  2. [ Client → Server ] On conversion, send the RTID to your server container via a GA4 Event.

    • sGTM GA4 Event Config
    • The trigger rule for the GA4 Event should be tied to the conversion event.
  3. [ Server-side ] Claim the RTID-containing request with a GA4 Client.

  4. [ Server-side ] Based on the incoming GA4 event name, conditionally fire an HTTP Request Tag to send a GET request toward Rokt’s postback endpoint.

    • sGTM HTTP Request
    • Include id, passbackconversiontrackingid, and conversiontype as params.
    • If successful, the tag should receive back a 200 response: {"statusCode":200,"success":true}
Verifying Conversions Received

As part of the QA process, your account manager will verify that all conversions have been received correctly by Rokt.

Was this article helpful?