ad:personam GmbH logo
Published on

Add Macros to Third-Party Ad Tags on ad:personam DSP

Learn how ad:personam automatically injects click and cachebuster macros into third-party ad tags using rule-based tag transformation for reliable tracking.

Adding macros to third-party ad tags is essential for accurate click and impression tracking in any DSP workflow. In ad:personam, macro insertion is handled automatically by a rule-based transformation utility, so you can upload tags faster with fewer manual fixes.

This guide explains what gets transformed, which macro patterns are supported, where to test your tag before publishing, and why some identifier requests, especially device ID injection, are intentionally not supported.

Related guides:


Which Macros ad:personam Uses

The transformation service standardises third-party tags to Adform-compatible macros:

MacroPurposeWhen to use
%%c1;cpdir=%%Click tracking (closed)Standard click parameters where the value IS the final destination (click=, clickurl=, ncu=, ${CLICK_URL})
%%c1;cpdir=Click tracking (open-ended)Redirect-prefix contexts where the tag's JS appends the landing page URL after the macro (data-click, .withClickMacro(), <noscript> fallback links)
__ADFRND__Cachebuster / random numberReplaces [timestamp], ${CACHEBUSTER}, Math.random() etc.
__ADFPAGEURL__Page URL from bid request (URL-encoded)Replaces ${REFERRER_URL}, ${PAGE_URL} and variants

Adform supports two equivalent delimiter styles: %%MACRO%% and __MACRO__. ad:personam uses __ for standard macros (Adform-recommended to avoid URL encoding issues) and %% only for click macros (%%c1;cpdir=%%) which have no __ equivalent.

These values are injected automatically where compatible placeholders or URL parameters are detected.

Device ID Macros Are Not Allowed in Third-Party Tag Transformations

Raw device identifiers such as IDFA, AAID, and similar mobile advertising IDs are not supported as third-party tag macros in ad:personam.

ad:personam does not inject raw device identifiers into generic third-party HTML tags or arbitrary tracking pixels during upload. This restriction is intentional and should be treated as a compliance rule, not as a missing transformation feature.

Why this restriction exists:

  • Passing a raw identifier to an unrelated third party can create an unauthorised identifier bridge between systems.
  • That kind of ID sharing can enable cross-site or cross-app profiling outside the original consent scope.
  • Client-side URL-based ID passing is also a common fingerprinting and data leakage risk, especially in mobile and embedded environments.

When identity matching is required, use an approved Adform identity workflow, verified partner integration, or a server-to-server / SDK-based setup that respects consent signals.


General Transformation Rules

ad:personam uses a deterministic rule set to detect and transform tags. The engine applies specific vendor rules first, then generic fallback rules.

Click Tracking Transformations

  • Replaces click placeholders such as ${CLICK_URL}, [CLICK_URL], %%CLICK_URL%%, %%CLICK_URL_UNESC%%, {CLICK_URL}, and %CLICK_URL% with %%c1;cpdir=%%
  • Rewrites click URL parameters like clickurl=, rdclick=, preredir=, preurl=, ct0=, and related variants to use Adform click tracking
  • Handles vendor-specific patterns including:
    • DCM data-dcm-click-tracker
    • Flashtalking ftClick
    • Sizmek ncu= and Sizmek noscript anchor redirects
    • DoubleClick click= parameters
    • AdTech ;rdclick= formats

Referrer and Page URL Transformations

  • Replaces REFERRER_URL and PAGE_URL placeholder families (including _ENC and _ESC encoded variants) with __ADFPAGEURL__

Cachebuster Transformations

  • Replaces cachebuster placeholders such as ${TIMESTAMP}, ${CACHEBUSTER}, %%CACHEBUSTER%%, [CACHEBUSTER], and [timestamp] with __ADFRND__
  • Normalises patterns like ord=[timestamp] to ord=__ADFRND__

Identifier Restrictions

  • Does not inject raw device IDs such as IDFA, AAID, or similar mobile advertising identifiers into generic third-party tags
  • Does not treat device ID requests as equivalent to supported click, cachebuster, or page URL macro substitutions
  • Leaves identity matching to approved Adform integrations, server-side workflows, or SDK implementations where consent and partner controls can be enforced

What Happens During Upload

When you upload a third-party tag, transformation is automatic as part of the upload pipeline:

  1. The tag is transformed client-side using the rule engine.
  2. The transformed code is validated by the Adform parser.
  3. If the parser recognises the vendor, parser-optimised code is used.
  4. If not recognised, the client-side transformed code is retained.

For the full upload workflow, validation, and publishing requirements, see How to Upload 3rd Party Tags.


Can I pass IDFA, AAID, or another device ID ?

No. Raw device identifiers cannot be passed to generic third-party pixels through ad:personam tag transformation.

Why not? Because raw device ID forwarding can create compliance and security issues:

  • It can leak user identifiers to third parties that were not approved for that data-sharing purpose.
  • It can enable cross-platform or cross-site profiling outside the original consent scope.
  • It can look like an attempt to work around platform privacy controls such as App Tracking Transparency (ATT).

What to do instead:

  • Use an approved Adform identity workflow when partner matching is required.
  • For mobile use cases, prefer server-to-server or SDK-based integrations over client-side pixel parameters.
  • Confirm that the required consent signal and legal basis are in place before enabling any identity matching.

Requests to append a raw device ID to a custom HTML tag or pixel URL should be escalated for compliance review before proceeding.


Best Practices

  1. Paste complete tag code, not partial snippets.
  2. Always provide a valid HTTPS click URL in the upload form.
  3. Wait for post-upload content analysis before publishing to a line item.
  4. For SDK-based tags (e.g. adftech, brzchecagem), always use the open-ended click macro (%%c1;cpdir=) since the SDK appends the landing page URL.
  5. Always use __ADFPAGEURL__ for the referrer/page URL macro to ensure server-side resolution.
  6. Do not treat raw device IDs as ordinary macros. If identity sharing is required, use an approved server-side, SDK, or partner integration instead of a client-side pixel parameter.
  7. Keep related setup instructions handy in How to Upload 3rd Party Tags.

Need complete upload instructions? Continue with How to Upload 3rd Party Tags.