Get the pixel and S2S tracking code
Open the Conversion tracking code window on a campaign, pick the ad-serving domain, copy the JS pixel, image pixel, landing-page snippet or server-to-server postback URL, install it and confirm the first conversion arrives — with the caveats and a fix-it checklist.
What it is and why
Once a conversion action is linked to a campaign, something on the advertiser’s side has to report each conversion back. The Conversion tracking code window on the campaign generates the three ways to do that — a browser pixel matched on the cookie your ad-serving domain wrote, the landing-page snippet matched on a click id the advertiser’s site stores, and a server-to-server postback your partner’s backend calls with the click id — all built against the ad-serving domain you pick at the top of the window. This page shows where to copy each one, what it does, and how to confirm the first conversion arrives.
Example. A purchase action is linked to the campaign “Spring Prospecting CPC”. The
advertiser’s web developer gets the JS pixel tracking block for the order-confirmation page;
their app-install partner gets the Conversion Tracking URL
https://ads.example.com/at?action=<key>&clickid=(clickid) and the landing URL
https://yourlanding.com/product?easclid=$$CLICK_ID$$ to store the click id from. Both report
against the same action, and within the hour of the first hit the action’s Activity badge
reads Live (it stays Live while a conversion landed in the last two days).
Typical scenarios
| You want | Copy | Where |
|---|---|---|
| Count purchases on an ordinary web thank-you page | JS pixel tracking | Pixel Tracking tab |
| A pixel for an email template or a page builder that only takes an image URL | Pixel tracking URL — and replace t=(timestamp) yourself | Pixel Tracking tab |
| Conversions from visitors whose browser blocks your cookie (Safari, private windows) | the Snippet block, installed on every page of the advertiser’s site | Snippet tab → Install the landing-page helper |
| App installs or offline conversions reported by a partner’s server | the Click ID Conversion Tracking URL, with $$CLICK_ID$$ in the landing URL | Postback (S2S) tab |
| A partner tracker already configured against another ad server’s postback | The same Click ID URL — the endpoint also reads cid, txid, event, goal and other spellings | Postback (S2S) tab |
| One block that fires every step of a funnel | Select the funnel on the card’s Funnels tab instead of an action; the window opens on the Snippet pane alone | the campaign’s Conversion actions card |
| You want to | Go to |
|---|---|
| Set each field of the Snippet tab | Snippet tab options |
Pass partner sub-values, send conversions on to a traffic source, wire an MMP link, price with payout, declare att= | Postback parameters and partner integrations |
| Find out why a conversion did not count | Why a conversion did not count |
Step by step
You need a conversion action (create one); for pixel tracking, the campaign’s Conversion actions card switched on — the pixel code embeds a key generated per advertiser + campaign + action, so it only exists in the campaign context; Manage Action Tracking switched on for your role (not read-only), which is what puts the search box and the Conversion tracking code button on the card; and access to the page or backend where the conversion happens.
- Open the window and pick the domain. Tick the action on the campaign’s Conversion actions card, open the Conversion tracking code window and choose the ad-serving domain every code in it is built against — Open the tracking window and pick the ad-serving domain.
- Browser-side: the pixel or the snippet. Copy the JS pixel or the image URL for the page a user reaches after converting, or the landing-page snippet the advertiser installs on every page of their site — Copy the pixel or the landing-page snippet.
- Server-side: the postback. Put
$$CLICK_ID$$in the landing URL and have the partner’s server call the Conversion Tracking URL with the value it stored — Set up a server-to-server postback. - Confirm the first conversion. Click the ad, convert in the same browser and watch the action’s Activity badge turn Live — Test a conversion.
Pick one of steps 2 and 3 per integration — running both buys you nothing.
Caveats and exceptions
Who can do this. The stock Network Manager role gets the whole of this page — the toolbar on the campaign’s Conversion actions card, the Pixel Tracking tab and the Postback (S2S) and Snippet tabs behind the tracking-code button — on every campaign and conversion action on the network, from the campaign card or from the action’s own edit page. The stock Advertiser role has none of it: you create and edit conversion actions on the Conversion Actions tab, but the campaign’s Conversion actions card and the three tabs are not shown. Your network manager attaches the action to the campaign and sends you the code, or switches on Manage Action Tracking, Action Tracking: Code and Action Tracking: Server-to-Server for your role; you then get this page over your own campaigns and those shared with you (see What your network controls; an advertiser who already has a code starts at Got a code from your network manager?). A publisher has no Conversion Actions section and no tracking-code tabs on the stock role. With a Can view share you can open the window and copy every code, but an Ad-serving domain pick is refused (Permission denied). With Manage Action Tracking read-only the card lists the actions but has no toolbar. Exact grants: User roles.
Pixel Tracking and Snippet exist only from a campaign. On the global Conversion Actions page (select a row and click Conversion tracking code) and on an action’s own edit page (the Conversion Tracking card) you only ever see the Postback (S2S) tab — by design, because the pixel code and the generated block are both campaign-specific. The URLs are otherwise identical; only the host differs, and it follows the Ad-serving domain selector in both places.
The same button serves the card’s Funnels tab. Select a funnel instead of an action and the window opens on the Snippet pane alone, building one block that names every step of the funnel in order — a funnel has no key and no pixel of its own, so there is nothing for the other two tabs to show. See Save a conversion funnel and report on it.
Not working?
The symptoms tied to one stage are on its page: the window and the domain on Open the tracking window and pick the ad-serving domain, the pixel and the snippet on Copy the pixel or the landing-page snippet, the postback on Set up a server-to-server postback, and the Activity badge and the log on Test a conversion.
| Symptom | Check | Where |
|---|---|---|
| Conversions land in Expired post-click / post-view | The cookie or click id is older than the action’s window. | the action’s windows on Create and edit conversion actions |
For the reason the ad server gives for a refused conversion, see Why a conversion did not count.
Reference
| Tab / block | What you get | Permission |
|---|---|---|
| Postback (S2S) → Click ID | Landing-URL example with easclid=$$CLICK_ID$$; Conversion Tracking URL /at?action=<key>&clickid=(clickid); optional att and payout | Action Tracking: Server-to-Server |
| Postback (S2S) → Click ID (per action, legacy) | $$SUB_ID(ActionName_ID)$$ macro; Conversion Tracking URL /at?subId=(subid) | Action Tracking: Server-to-Server |
| Snippet | The landing-page helper block, HTML or Google Tag Manager format; campaign only | Action Tracking: Server-to-Server |
| Pixel Tracking → JS pixel tracking | Script requesting a 1×1 image from /action.gif; campaign only | Action Tracking: Code |
| Pixel Tracking → JS pixel tracking with piggybacks | Script loading /action.js; shown with the Piggybacks card on and the Piggyback Pixel Tracking permission | Action Tracking: Code |
| Pixel Tracking → Pixel tracking URL | The bare /action.gif URL with a t=(timestamp) you replace | Action Tracking: Code |
| Ad-serving domain | One pick for every code in the window; saved on the campaign | Action Tracking: Code + Update on the campaign to save |
Accepted parameter spellings on the Conversion Tracking URL: click id — clickid, actionData,
cid, txid; key — action, actionKey, event, goal, event_id, goal_id. For the
action-level settings that govern matching (attribution windows, per-IP duplicate windows,
detailed log), see the field table in
Create and edit conversion actions.
Server-to-server (postback)
The facts behind the postback subpage: the legacy per-action macro, and the tokens on the tab.
Click ID (per action, legacy)
Collapsed in the window, and kept only for integrations already on it. It works the same way, but the value is issued per action rather than per click, so a new integration should use Click ID — Set up a server-to-server postback.
-
Put the Sub ID macro in the landing page URL in your creative. The tab shows the macro for your action, in the form
$$SUB_ID(ActionName_ID)$$:https://yourlanding.com/product?subid=$$SUB_ID(purchase_22)$$The ad server replaces it when it serves the ad, so your page is reached with a unique value in
subid=. Store that value with the visit. -
When the user converts, request the Conversion Tracking URL from your server, with the value you stored in place of
(subid):https://<ad-serving-domain>/at?subId=(subid)
What you replace, and what is replaced for you
Two kinds of token appear on this tab, and each belongs to exactly one of the two URLs:
| In this URL | Written as | Filled in by |
|---|---|---|
| The landing page URL, in your creative | $$CLICK_ID$$, $$SUB_ID(purchase_22)$$ | The ad server, when it serves the ad |
| The Conversion Tracking URL, called by your server | (clickid), (subid) | You, before you call the URL |
The round brackets are deliberate: the URL has to survive being fired exactly as copied, and the
ad server rejects a request URL containing < > | { } with a 400.
Nothing else is baked into the URL. The tab lists two Optional parameters beside it — att
and payout, both covered in
Postback parameters and partner integrations — for the integrations
that need them; leave both off and the conversion is counted at the campaign’s own CPA rate,
classified from whatever the stored value carries. The partner-facing side of the postback —
sub1 to sub10, forwarding a traffic source’s click ID, AppsFlyer and other attribution
links, payout, att= and the action’s default attribution type — is on that page too.
Via the API
GET /rest-api/action/id/{id}/tracking-code.do answers what this window shows, under the same
permissions: postback (the S2S tab — actionTrackUrl, the landing-page example with
easclid=$$CLICK_ID$$, and the legacy subIdMacro / subIdLandingUrlExample /
subIdActionTrackUrl) with the S2S permission, and pixel (jsPixelCode, the image
pixelTrackingUrl, and jsPixelCodeWithPiggybacks when the campaign has piggybacks on and your
role may use them) with the pixel-tab permission and a campaignId — the pixel is
campaign-specific, so without one the pixel-only caller gets a 400. host picks the ad-serving
domain the way the selector above the tabs does (one of the served domains, else 400); left out,
the codes use the campaign’s saved pixel domain (failing that the network’s system default), or
the system default when no campaignId is sent, and the answer names the one used in host. An
unknown action or campaign is a 404; an action or campaign you cannot see, or a role holding
neither tracking permission, is a 403. The landing-page snippet is not part of it.
Related pages:
- Conversion tracking overview
- Open the tracking window and pick the ad-serving domain
- Copy the pixel or the landing-page snippet
- Set up a server-to-server postback
- Test a conversion
- Postback parameters and partner integrations
- Why a conversion did not count
- Snippet tab options
- Create and edit conversion actions
- Install the landing-page helper
- Save a conversion funnel and report on it
- Piggyback pixels
- Server-side trackers
- Third-party tracking codes
- Macros reference
- Run a report
- Analytics discrepancies