Before implementing AdTag on your site, you'll need to receive the following from us:
YOUR_TOKEN
)YOUR_PUBLISHER_ID
)Contact your account manager to receive these credentials before proceeding.
First, add a container element where you want the ad to appear:
<div id="scrptk-container"></div>
Add this script to your page, preferably in the head or just before the closing body tag:
<script src="https://sdk.scrptk.com/tag.js?token=YOUR_TOKEN"></script>
Replace YOUR_TOKEN
with the publisher token we provided.
Add this script after the SDK is loaded:
<script>
// Initialize the ad
Tag.create({
publisherId: 'YOUR_PUBLISHER_ID',
placement: 'YOUR_PLACEMENT_ID',
target: '#scrptk-container'
});
</script>
Replace:
YOUR_PUBLISHER_ID
with your assigned publisher IDYOUR_PLACEMENT_ID
with the placement ID for this location#scrptk-container
with your target element selectorFor production sites, we recommend this fail-safe loading pattern:
<div id="scrptk-container"></div>
<script>
(function(w, d, s, id) {
// Skip if already loaded
if (d.getElementById(id)) return;
// Create script element
var js = d.createElement(s);
js.id = id;
js.src = "https://sdk.scrptk.com/tag.js?token=YOUR_TOKEN";
js.async = true;
// Initialize when loaded
js.onload = function() {
if (w.Tag) {
Tag.create({
publisherId: 'YOUR_PUBLISHER_ID',
placement: 'YOUR_PLACEMENT_ID',
target: '#scrptk-container'
});
}
};
// Add to page
var firstScript = d.getElementsByTagName(s)[0];
firstScript.parentNode.insertBefore(js, firstScript);
})(window, document, 'script', 'tag-sdk-' + Math.random().toString(36).substring(2, 7));
</script>
Add context data to improve ad targeting and relevance:
Tag.create({
publisherId: 'YOUR_PUBLISHER_ID',
placement: 'YOUR_PLACEMENT_ID',
target: '#scrptk-container',
context: {
subaff1: '12345',
subaff2: '404 Page',
subaff3: 'Google Display',
subaff4: 'Unique Visitor',
email: 'test@gmail.com',
firstName: 'John',
lastName: 'Smith',
gender: 'M',
age: '36',
city: 'Springfield',
state: 'MA',
zip: '01111',
clickid: 'YOUR_TRANSACTIONID'
}
});
Parameter | Type | Description | Example | Required |
---|---|---|---|---|
subaff1 |
String | Subaffiliate Identifier | eg. 22858 | Yes |
subaff2 |
String | Placement Type Identifier | eg. "Thank You" Page, Post-Registration | No |
subaff3 |
String | Traffic Type Identifier | eg. Facebook, Google Search, Path | No |
subaff4 |
String | Audience Name Identifier | eg. Homeowner, Car Owner, Purchaser | No |
clickid |
String | User + Click Identifier | eg. TransactionId, ClickId | No |
Parameter | Type | Description |
---|---|---|
email |
String | User's email address |
emailmd5 |
String | MD5 hash of email |
emailsha256 |
String | SHA256 hash of email |
phoneNumber |
String | User's phone number |
firstName |
String | User's first name |
lastName |
String | User's last name |
address1 |
String | Address line 1 |
address2 |
String | Address line 2 |
city |
String | City |
state |
String | State/province |
zip |
String | Postal/ZIP code |
gender |
String | User's gender (M/F) |
dobDay |
String | Day of birth |
dobMonth |
String | Month of birth |
dobYear |
String | Year of birth |
age |
String | User's age |
Track conversions in real-time by configuring server-to-server postbacks. When a payable conversion occurs, we'll automatically notify your server with the conversion details.
To receive conversion notifications, provide your postback URL to your Account Manager and pass your transacionId into the context clickid field when initatlizing the Tag.
Tag.create({
publisherId: 'YOUR_PUBLISHER_ID',
placement: 'YOUR_PLACEMENT_ID',
target: '#scrptk-container',
context: {
clickid: 'YOUR_UNIQUE_TRANSACTION_ID'
// ... other context parameters
}
});
When a conversion occurs, we'll make a GET request to your postback URL with the following query parameters:
Parameter | Description | Example Value |
---|---|---|
{clickid} |
Your unique transaction ID passed via the clickid parameter | ABC123XYZ789 |
{payout} |
The conversion payout amount in USD | 12.50 |
When you pass a clickid of ABC123XYZ789
and a conversion worth $12.50 occurs, we'll call:
GET https://yourserver.com/conversion?tid=ABC123XYZ789&revenue=12.50
Once implemented, the AdTag can display ads in various formats depending on your configuration. Each format designed for different user experiences and monetization goals.
For integration assistance or questions, contact your account manager.