Retargeting Tag
Load our tag from the following URL:
https://static.traversedlp.com/v1/retargeting.js
For example:
<script src="https://static.traversedlp.com/v1/retargeting.js" type="text/javascript"></script>
This instantiates a TraverseRetargeting singleton. After initializing it, you can include a user in a campaign. If you would like to later exclude that user, you can call the exclude method.
Initialization
Before using the TraverseRetargeting singleton, it must be initialized with your advertiser ID:
| Parameter | Description | Required |
|---|---|---|
advertiserId |
Your provided 36-character client ID (includes hyphens). | Yes |
TraverseRetargeting.init({
advertiserId: "YOUR-ADVERTISER-ID-HERE"
});
Inclusion
To include a user in a campaign, use the include method:
| Parameter | Description | Required |
|---|---|---|
campaignId |
Your provided 36-character campaign ID (includes hyphens). | Yes |
TraverseRetargeting.include({
campaignId: "YOUR-CAMPAIGN-ID-HERE"
});
Exclusion
To exclude a user from a campaign, use the exclude method:
| Parameter | Description | Required |
|---|---|---|
campaignId |
Your provided 36-character campaign ID (includes hyphens). | Yes |
TraverseRetargeting.exclude({
campaignId: "YOUR-CAMPAIGN-ID-HERE"
});
Example Code
The following is an example of the full code used to include a user in a campaign. Please be sure to replace the ALL-CAPS-STRINGS with your advertiserId and campaignId.
<script src="https://static.traversedlp.com/v1/retargeting.js" type="text/javascript"></script>
<script type="text/javascript">
TraverseRetargeting.init({
advertiserId: "YOUR-ADVERTISER-ID-HERE"
});
TraverseRetargeting.include({
campaignId: "YOUR-CAMPAIGN-ID-HERE"
});
</script>
Advanced Usage - Advertiser Properties
In addition to the campaignId, an advertiserProperties parameter may be
passed to the retargeting tag. The advertiserProperties is used to provide
additional context about the inclusion, and is typically used by advertisers
who consume campaign requests.
The advertiserProperties object may be used like so:
TraverseRetargeting.include({
campaignId: "YOUR-ADVERTISER-ID-HERE",
advertiserProperties: {
foo: "bar",
baz: 1
}
});