Skip to main content

Ads and growth

AdRoll

AdRoll retargets site visitors with ads and measures conversions. The c15t adrollPixel helper waits until the marketing category is allowed before it sets the AdRoll globals, queues the first pageView and adds the loader.

AdRoll has no API to stop its pixel. When the visitor withdraws, the helper leaves AdRoll on the page, and c15t's default page reload removes it.

Configure AdRoll

Copy the advertiser ID and pixel ID from Analytics > Insights > Website > View Pixel. Under Settings > Data Collection > Visitor Consent, choose Use your existing Consent Banner. Otherwise AdRoll can show its own banner. AdRoll's instructions for an existing banner say to wait for affirmative consent before you deploy the pixel. The helper loads AdRoll once the marketing category is allowed. Under an opt-out policy that can happen before the visitor chooses, so use an opt-in policy if you need affirmative consent. Delete the direct pixel snippet and any tag manager copy, so they can't load AdRoll without consent.

npm install @c15t/integrations
src/consent-scripts.ts
import { adrollPixel } from '@c15t/integrations/adroll';

export const scripts = [
	adrollPixel({ advertiserId: 'ADVERTISER_ID', pixelId: 'PIXEL_ID' }),
];

Register the scripts

Complete your framework quickstart first. Keep its Inth endpoint, policy, styles and consent UI. Remove the vendor's original script, SDK initializer or tag-manager entry, so the vendor loads only through c15t.

The vendor pages put the helper in src/consent-scripts.ts. If your framework quickstart already has a scripts array, such as the one in c15t.config.ts in the Next.js guide, add the helper to that array instead of creating a second file. The scripts export is a configuration, not an initializer. Add it to the c15t provider you already have, at the registration point for your framework below. These are edits to that provider, not a second provider.

Add the configuration to scripts in c15t.config.ts, next to next.config.ts:

import { defineConsentConfig } from 'c15t/next';
import { scripts } from './src/consent-scripts';

export default defineConsentConfig({ scripts });

Keep the rest of your config, such as mode and routePrefix, in the same call. ConsentRoot reads the config in the browser, so the layout keeps passing only state. App Router, Pages Router and static export all read the same file. See Next.js scripts and embeds.

Options

OptionDefaultBehavior
advertiserIdRequiredPublic advertiser ID from the v2 snippet. Trimmed and URL-encoded into the loader path. If it's missing or blank, c15t logs an error and never loads AdRoll.
pixelIdRequiredPublic pixel ID from the same snippet. Trimmed. If it's missing or blank, c15t logs an error and never loads AdRoll.
scriptUrlhttps://s.adroll.com/j/<advertiserId>/roundtrip.jsOverride for the account-specific v2 loader. A blank value uses the default.

Loading and revocation

When marketing is allowed, the helper sets adroll_adv_id, adroll_pix_id, adroll_version and __adroll_loaded. It creates the window.adroll array queue with setProperties, identify and track stubs. Each stub pushes the method name and its arguments object, which is the format AdRoll replays. The helper calls track('pageView') once, then adds the advertiser's v2 loader as an async script. The generic https://s.adroll.com/j/roundtrip.js is a different, legacy v1 loader.

If your page already defines window.adroll or any of those methods, the helper keeps them and sends the pageView through them. On server-rendered pages, the helper doesn't start from the server HTML. It always starts in the browser script loader, also when the visitor's consent was saved earlier.

The helper doesn't send email addresses or other identity data. Send further events and identity data through AdRoll's JavaScript API, and only while marketing and any vendor consent stay granted.

AdRoll documents no public stop or teardown API, and the helper sends no withdrawal command. On withdrawal, it keeps the loader element on the page. Keep c15t's default reloadOnConsentRevoked enabled. With reload disabled, loaded code, partner pixels and timers can keep running until the visitor navigates. If the visitor grants consent again on the same page, the helper reuses the loader and doesn't send a second pageView.

Cookies and storage

NextRoll's privacy notice names the __adroll, __ar_v4, __adroll_shared and __adroll_fpc tracking cookies. The served code also writes consent cookies, local storage such as __adroll_consent_data, session storage such as adroll_tpc and adroll_flgs, and an adroll IndexedDB database. Account and partner settings change this list. AdRoll can set storage as soon as the loader runs, which is why the whole loader waits for consent.

Verify AdRoll

In a fresh browser profile, deny consent and allow only an unrelated category. Filter Network by adroll.com and confirm that no requests, globals, cookies, local storage, session storage or IndexedDB appear. Grant marketing and check the loader URL against your account snippet. Withdraw consent and confirm the page reloads. AdRoll must stay blocked on the new page. Check storage in DevTools as well as Network.

The c15t monitor runs public house-account IDs with collection blocked, because AdRoll's sample IDs return access-denied responses. It also blocks the JSONP consent check. It confirms that the SDK starts and stays behind consent. It doesn't confirm your account's configuration, conversion delivery or partner behavior.

Sources: installation article, existing consent banners, JavaScript API and NextRoll privacy notice.

Test in a private window with an opt-in policy. Open DevTools Network, disable the cache and filter by the vendor's domain:

  1. Load the page. No request goes to the vendor before you choose.
  2. Click Reject, then reload. There is still no vendor request.
  3. Open Privacy settings and allow the helper's category. The vendor script loads without a page reload.
  4. Turn the category off again and save. c15t reloads the page, and the new page makes no vendor request.

c15t reloads on revocation because removing a script element does not stop code that already ran. The vendor's listeners, timers and queued events stay alive until the page unloads. If you set reloadOnConsentRevoked: false, stop the vendor yourself. Register a callback-only script whose onConsentChange calls the vendor's opt-out API, as shown in custom integrations, and check the permission before each of your own event calls. The reload does not delete cookies the vendor already set; see clear on revocation for your framework.

The helper lists its vendor by name in the preference dialog, so a visitor can turn it off inside an allowed category. See vendor consent for your framework. The consent verification guide covers navigation, expiry and hosting checks.