Segment
The Rokt destination optimizes campaign performance by integrating conversion attribution for Rokt Ads. By integrating this conversion data, you’ll unlock a suite of intelligent tools that learn from every conversion, constantly making adjustments to improve campaign targeting and bidding.
Adding the Rokt Segment destination
Before you begin, please ensure you have your Rokt Account ID. To find yours, see the instructions here.
Log into your Segment account.
Click Catalog.
Click Destinations.
Search for “Rokt”.
Click to open the Rokt Segment.
Click Configure Rokt.
Select the data source that you want to configure and then click Next.
Settings:
You can get the following configuration values from One Platform under profile settings. Contact your account manager for any issues with these credentials.
Setting | Data type | Description |
---|---|---|
Account ID | string | Your Rokt Account ID. |
AppSecret (also known as API Key in Segment) | string | You can generate this through the profile settings one One Platform. |
App ID | string | You can generate this through the profile settings one One Platform. |
Testing the Rokt destination
Once you have ensured the Rokt Segment destination is installed, authentication details are entered, and all attributes have been connected, you can test the Rokt segment destination in the following ways:
Testing the connection to Rokt
From your Segment workspace Connections tab select the newly created Rokt destination.
On the Settings tab for the Rokt destination ensure that all the connection settings have been filled out correctly, with the information provided by your Rokt account manager.
Click the Event Tester
Choose Event Builder as the event tester type.
Configure the Event Builder:
- Select Track from the "Call Type" drop-down menu.
- Leave the User ID as the default strong created by Segment.
- Under "Properties", make sure that the entries for "Key" and "Value" are the same as the data attributes that you are integrating with Rokt.
For example, if you’re integratingemail address
,firstname
,last name
, andzipcode
with Rokt, ensure that these fields are populated with appropriate string values.
Click Send Event.
noteYou should receive a "200 OK" response if you've successfully connected to Rokt. Please contact your account manager to check that the data attributes were correctly captured in Rokt’s system for the test event.
If any other response besides "200 OK" is received, please contact your Rokt account manager to troubleshoot the issue.
Activate the Rokt destination
- From the Workspaces page, click Connections.
- Click Destinations tab.
- Click the toggle next to the Setup Guide to activate the destination.
End to end testing
Once the Rokt destination is activated, please speak with your account manager to perform end to end testing on the integration. This will typically involve performing test purchases on your staging or production site to ensure all data attributes are correctly integrated. Your Rokt account manager will advise on the exact testing steps here, as well as perform any additional testing and QA.
Integrate Rokt ID with Segment
The following are instructions to integrate Rokt ID on your landing page with Segment. More information on Rokt ID.
Add the Rokt ID tag to your landing page.
On your conversion page, grab the Rokt ID value from localStorage or cookies and add it to the payload of the Segment track call with the name
passbackconversiontrackingid
. This method assumes you are using the Analytics.js library and the track API.Example code snippet where Rokt ID is stored in cookies//Grab Rokt ID from cookies
const cookieArr = decodeURIComponent(document.cookie).split('; ');
const str = "RoktTransactionId="
let passbackconversiontrackingid = "";
cookieArr.forEach(val => {
if (val.indexOf(str) === 0)
passbackconversiontrackingid = val.substring(str.length);
})
//Pass the RoktID (passbackconversiontrackingid) within the payload of the Segment track call
analytics.track('ConversionEvent', {
passbackconversiontrackingid: passbackconversiontrackingid,
});