Adform is a company specializing in digital advertising solutions. They offer a range of services including efficient workflows, omnichannel reach, and better optimization of working media. Adform focuses on maximizing the use of data for competitive advantage, preparing for a cookieless future, and providing solutions for sustainable trading.
We created the Adform tag to make the Adfrom integration process simpler. In this article, I'll show you how to set up this tag using server-side Google Tag Manager, how to pair it with the Adform Cookie Retrieval Script tag in the web container, and why that combination gives you complete attribution coverage.
The Adform tag for sGTM captures the Adform cookie ID from URL parameters on ad clicks. When a user clicks an Adform ad, the landing page URL includes identifiers such as adfcookieid. The server tag stores that value in a first-party adfuid cookie and later uses it to attribute conversions.
View-through conversions work differently. The user sees an ad, doesn’t click, and later converts. There is no click, so the cookie ID never appears in the URL. The sGTM tag has nothing to store, and those conversions would be lost if you relied on URL parameters alone.
The Adform Cookie Retrieval Script tag in the web container closes that gap. It acts as a safeguard:
adfuid cookie.adfuid cookie is already present in the browser.adfuid cookie.Using the Adform tag inside server Google Tag Manager with the Adform Cookie Retrieval Script in the web container helps you track conversions with more accuracy and less hassle.
Here’s what you get when you move this setup to the server:
adfcookieid in the URL. View-through conversions are recovered by the web tag and stored as the same first-party adfuid cookie. The sGTM tag reads that cookie from the request headers so both paths are attributed.This way, your campaign results reflect reality, not just what the browser felt like showing.
2. Send data to the server GTM container. The two most popular ways of sending data to sGTM are by setting server-side Google Analytic 4 and Data Tag/Data Client.

4. At the top-right, click three dots → Import.

5. From the unzipped folder, select the template.tpl file.
6. Click Save.

7. Go to Tags and click New.

8. Click Tag Configuration and select Adform Cookie Retrieval Script by Stape.

9. In Cookie Settings you can set the following:
shop.example.com), only that exact subdomain can read the cookie; other subdomains on example.com won’t have access to it. Leaving it as auto is the standard setup to automatically set the cookie on the highest possible parent domain. For example, if a user visits shop.example.com, auto writes the cookie to .example.com. This ensures the cookie is shared across all subdomains (like blog.example.com or checkout.example.com).adfuid cookie stored before automatically deleting it.
10. Select a trigger. Trigger the tag on the page load (such as Initialization / All Pages, or dom – page view).
11. Click Save.


3. Search for Adform Tag.

4. Click Add to workspace and confirm.

5. Go to Tags and click New.

6. Click Tag Configuration and select Adform tag.

7. There are two configuration types that Adform tag includes: PageView and TrackEvent.
adfcookieid and adfcd URL parameters inside the adfuid and _adfcd cookies, respectively. You should add the Adform Cookie ID (also known as Third-Party Cookie ID) (__ADFUID__ macro) and Adform Click ID (__ADFCD__ macro) parameters that were used in Adform campaign settings. Update adfuid and _adfcd cookie lifetime if needed in Cookies Settings.
__ADFCD__). If left blank, the value is taken from the _adfcd cookie.
8. In Tag Execution Consent Settings you can control whether a tag fires and sends HTTP request data based on the user's consent status:
ad_storage consent (Google Consent Mode or Stape's Data Tag parameter) isn’t granted.
9. Select a trigger. Select a custom trigger with a suitable name for your events. For example, for page views the Event Name for the trigger is page_view.
10. Click Save.


2. Open your test URL with valid Adform parameters attached. For example, https://example.com/?adfcookieid=123456789012345678&adfcd=123456.abcde.fghij In this case we’re simulating the scenario where the web tag checks the page URL for the cookie ID (adfcookieid) and, if present, saves it as a first-party adfuid cookie. After that the cookie value is passed to the server.
3. Go to Application → Storage → Cookies → your domain. Verify that the adfuid cookie is created with the value 123456789012345678. Verify that _adfcd is created with 123456.abcde.fghij.

4. Do some actions on the site to trigger the events.
5. In sGTM preview, confirm the Adform tag fires successfully.

6. Open the Outgoing HTTP Requests tab and locate your forwarded cookie ID and click ID.

Moving your Adform tag to the server container is more than a technical change. This decision will make your conversion data cleaner and your tracking setup simpler.
The server tag captures Cookie IDs from ad clicks in the URL. The web Cookie Retrieval Script tag is the safeguard for everything the URL never contains: it stores a click ID when one is present, and otherwise retrieves the ID from Adform so view-through conversions can be attributed too. The sGTM tag reads the first-party adfuid cookie from the request headers in both cases, with no extra variable mapping in standard setups.
Instead of trying to fill the gaps caused by browser limits, you’re sending reliable signals directly from your cloud server – with a complete identifier, whether the user clicked the ad or only saw it.
If you use Adform in your ad strategy, this web + server setup gives you the precision and stability to get the most from it.
Comments