How AdRoll Tracking Works
AdRoll tracking is built around the AdRoll Pixel, a JavaScript snippet that loads from s.adroll.com and sends user activity data to AdRoll's servers for retargeting and attribution. The pixel uses two key identifiers configured in your account:
adroll_adv_id-- Your advertiser ID (unique per AdRoll account)adroll_pix_id-- Your pixel ID (unique per tracking pixel)
When the pixel fires, it:
- Sets a first-party cookie (
__adroll) containing a hashed user identifier - Sends the current page URL, referrer, and device metadata to
d.adroll.com - Syncs the user ID with AdRoll's cross-device identity graph via cookie-sync pixels fired to partner ad exchanges
- Matches the user against your configured audience segments (all visitors, product viewers, cart abandoners, etc.)
AdRoll's identity resolution operates through a cross-device graph that links browser cookies, mobile advertising IDs, and hashed email addresses. When a user is identified across devices, ad delivery and attribution span desktop, mobile web, and in-app inventory.
Data collected by the pixel feeds into AdRoll's bidding engine, which participates in real-time auctions across display networks, Facebook, Instagram, and native ad inventory.
Installing the AdRoll Pixel
Place the base pixel on every page of your site, typically just before </body>:
<script type="text/javascript">
adroll_adv_id = "AAAAAAAAAAAAAAAAAAAAAA";
adroll_pix_id = "BBBBBBBBBBBBBBBBBBBBBB";
(function () {
var _onload = function(){
if (document.readyState && !/loaded|complete/.test(document.readyState)){
setTimeout(_onload, 10); return;
}
if (!window.__adroll_loaded){
__adroll_loaded = true;
setTimeout(_onload, 50); return;
}
var scr = document.createElement("script");
var host = (("https:" == document.location.protocol) ? "https://s.adroll.com" : "http://a.adroll.com");
scr.setAttribute('async', 'true');
scr.type = "text/javascript";
scr.src = host + "/j/roundtrip.js";
((document.getElementsByTagName('head') || [null])[0] || document.getElementsByTagName('script')[0].parentNode).appendChild(scr);
};
if (window.addEventListener) window.addEventListener('load', _onload, false);
else window.attachEvent('onload', _onload);
}());
</script>
Replace AAAAAAAAAAAAAAAAAAAAAA and BBBBBBBBBBBBBBBBBBBBBB with your actual adroll_adv_id and adroll_pix_id values from the AdRoll dashboard under Settings > AdRoll Pixel.
For tag manager deployments (GTM), use a Custom HTML tag with the same snippet. Set the trigger to fire on All Pages.
Conversion Tracking
AdRoll conversion tracking uses the __adroll.record_user function to fire named events. These events map to conversion actions configured in the AdRoll dashboard.
Standard Page Conversion
For pages where the URL itself indicates a conversion (e.g., /thank-you), configure a URL-based conversion in the AdRoll dashboard. No additional code is needed beyond the base pixel.
Custom Conversion Events
For event-based conversions (button clicks, form submissions), fire events programmatically:
<script type="text/javascript">
try {
__adroll.record_user({"adroll_segments": "purchase"});
} catch(err) {}
</script>
Revenue Tracking
Pass order value and order ID for purchase events:
<script type="text/javascript">
try {
__adroll.record_user({
"adroll_segments": "purchase",
"adroll_conversion_value": 149.99,
"adroll_currency": "USD",
"order_id": "ORD-12345"
});
} catch(err) {}
</script>
Product-Level Events for Dynamic Ads
If you are running AdRoll Dynamic Ads, you must pass product IDs that match your product feed:
<script type="text/javascript">
try {
__adroll.record_user({
"adroll_segments": "viewed_product",
"product_id": "SKU-789"
});
} catch(err) {}
</script>
For cart events:
<script type="text/javascript">
try {
__adroll.record_user({
"adroll_segments": "added_to_cart",
"product_id": "SKU-789"
});
} catch(err) {}
</script>
Segment names (purchase, viewed_product, added_to_cart) must match the segment keys configured in the AdRoll dashboard under Audiences > Segments.
Audience and Retargeting Configuration
AdRoll builds audiences from pixel data and supports several segment types:
Behavioral Segments (Automatic)
- All Visitors -- Anyone who triggered the base pixel
- Product Viewers -- Users who fired
viewed_productevents - Cart Abandoners -- Users who fired
added_to_cartbut notpurchase - Converters -- Users who fired
purchaseevents
Segments have configurable lookback windows (default 30 days, max 540 days).
CRM Audience Imports
Upload customer lists for targeting or suppression:
- Navigate to Audiences > CRM Data in the AdRoll dashboard
- Upload a CSV with
email(plaintext or SHA-256 hashed),phone, ormailing_addresscolumns - AdRoll matches records against its identity graph and creates a targetable segment
Match rates typically range from 40-70% depending on data quality and email provider distribution.
Lookalike / Prospecting Audiences
AdRoll generates lookalike audiences from your highest-performing segments using its cross-device graph. These are configured under Campaigns > Prospecting and require a minimum seed audience of 1,000 matched users.
Dynamic Ads
Dynamic retargeting ads require:
- Product feed -- Upload via the AdRoll dashboard or provide a feed URL (Google Shopping XML format accepted). Must include
id,title,image_link,link,price, andavailability. - Product-level pixel events --
viewed_productandadded_to_cartevents with matchingproduct_idvalues. - Creative template -- Selected or customized in the AdRoll Creative Builder.
Server-Side / Pixel API Integration
The AdRoll Pixel API enables server-side event tracking for environments where client-side JavaScript is unreliable.
Sending a Server-Side Event
curl -X POST "https://d.adroll.com/pixel/v2/event" \
-H "Content-Type: application/json" \
-d '{
"adroll_adv_id": "AAAAAAAAAAAAAAAAAAAAAA",
"adroll_pix_id": "BBBBBBBBBBBBBBBBBBBBBB",
"events": [
{
"event_name": "purchase",
"conversion_value": 149.99,
"currency": "USD",
"order_id": "ORD-12345",
"email_sha256": "a1b2c3d4e5f6..."
}
]
}'
AdRoll REST API for Audience Management
The AdRoll API (services.adroll.com/api/v1/) supports programmatic audience and campaign management:
# List all audience segments
curl -X GET "https://services.adroll.com/api/v1/segment/get" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d "advertisable=AAAAAAAAAAAAAAAAAAAAAA"
# Create a new segment
curl -X POST "https://services.adroll.com/api/v1/segment/create" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d "advertisable=AAAAAAAAAAAAAAAAAAAAAA" \
-d "name=high_value_buyers" \
-d "match_type=url" \
-d "match_value=/checkout/complete"
API authentication uses OAuth 2.0 tokens generated from the AdRoll developer console.
Common Issues
Pixel Not Firing on Page Load
The AdRoll pixel uses a deferred loading pattern (window.addEventListener('load', ...)) which means it fires after all page resources have loaded. On slow pages, this can delay pixel execution by several seconds. Verify the pixel is loading by checking the Network tab for requests to d.adroll.com. If blocked:
// Quick check in browser console
console.log("AdRoll loaded:", typeof __adroll !== 'undefined');
console.log("Adv ID:", typeof adroll_adv_id !== 'undefined' ? adroll_adv_id : 'NOT SET');
__adroll.record_user Throws ReferenceError
The record_user function is only available after roundtrip.js finishes loading. If you call it before the pixel initializes, it throws an error. Always wrap calls in try/catch, and for SPAs, verify the function exists before calling:
function trackAdRollEvent(segmentName, data) {
if (typeof __adroll !== 'undefined' && typeof __adroll.record_user === 'function') {
__adroll.record_user(Object.assign({ adroll_segments: segmentName }, data));
}
}
Conversion Segments Not Populating
Segment names in record_user calls must exactly match (case-sensitive) the segment keys configured in the AdRoll dashboard. A mismatch silently drops the event. Verify segment names under Audiences > Segments and compare against your pixel implementation.
Cross-Device Attribution Gaps
AdRoll's cross-device graph relies on cookie sync and hashed email matching. If users never log in or provide email on your site, cross-device resolution drops significantly. Passing email_sha256 with the pixel (when available) improves match rates.
Dynamic Ad Products Showing Out-of-Stock Items
The product feed is typically refreshed on a schedule (daily by default). If inventory changes frequently, increase the feed refresh frequency or use the feed API to push updates. Out-of-stock products in dynamic ads are a common source of wasted spend.
Platform-Specific Considerations
Cross-Device Identity Graph -- AdRoll maintains a proprietary identity graph spanning over 1.2 billion user profiles. The graph links browser cookies, mobile ad IDs (IDFA/GAID), and hashed PII. Match quality degrades in Safari (ITP) and Firefox (ETP) due to first-party cookie restrictions. Hashed email passthrough is the most reliable cross-device identifier.
Ad Network Reach -- AdRoll bids across Google Display Network, AppNexus, OpenX, and several other exchanges for display inventory. Social retargeting runs through direct API integrations with Facebook/Instagram and TikTok. Each channel has separate campaign configuration but shares audience segments.
Attribution Model -- AdRoll defaults to a 28-day click / 1-day view attribution window. This means a conversion is attributed to AdRoll if the user clicked an AdRoll ad within 28 days or viewed one within 1 day before converting. This can be adjusted in campaign settings but cannot be set below 1-day click / 0-day view.
Shopify Integration -- AdRoll provides a native Shopify app that auto-installs the pixel and imports the product feed. The app handles viewed_product, added_to_cart, and purchase events automatically. Manual pixel installation is not required when using the app, but custom segments still need explicit record_user calls.
Data Export -- Conversion and impression-level data can be exported via the AdRoll dashboard (CSV) or the Reporting API (services.adroll.com/api/v1/report/). Raw log-level data (bid requests, impressions, clicks) is available on Enterprise plans only.