Browse the help center

Email ad codes on a site

Put ads in a newsletter with the script-free email tag — what the generated image-plus-link markup contains, the rand value that keeps impression and click on the same creative, how it counts — and mail any placement's tags to the people who paste them with the site's Email ad tags dialog, with the caveats and a fix-it checklist.

How-to network manager admin Account → Publishers → site → Actions → Email ad tags

What it is and why

Email inventory cannot run scripts, so its ad code is the simplest tag the platform generates: a click link wrapping an image. The image request picks the banner and counts the impression; the link counts the click and lands on the same banner’s page. This page covers what that markup contains and how it tracks, plus the site-level Email ad tags dialog — the tool that mails any placement’s tags (email or otherwise) straight to the people who will paste them.

Example. A newsletter with 20,000 subscribers carries one Email placement. The sending platform replaces rand=<SET_UNIQUE_AD_ID_HERE> with its message id, so each of the 20,000 mails has its own value. 8,000 readers open the mail: 8,000 image fetches, 8,000 CPM impressions, each remembering “this message → banner X” for 24 hours. 240 of them click; every click resolves to the banner that reader actually saw. Leave the placeholder in and all 240 clicks resolve against whichever banner was cached last.

Typical scenarios

You wantDoWhere
Ads in a newsletter sent from a mailing platformCopy the Email tab’s snippet and replace <SET_UNIQUE_AD_ID_HERE> with the platform’s per-message merge tag, in both URLsPlacement → Ad tags & API → Email
Build the mail yourself from two URLsUse the read-only Creative URL (the image) and Landing page URL (the click), same rand on bothUnder the snippet on the same tab
Send a site owner every tag they need in one mailActions → Email ad tags, tick the placements, SendThe site editor header
One .txt per placement and tag type instead of one fileTurn Send as a single file offThe mailing dialog
A custom covering textOpen More details and edit Subject / HTML Body before SendThe mailing dialog
Mail tags from a scriptPOST /rest-api/sites/{siteId}/invocation-codes/send.doSee Over the API

Step by step

Copy the email code for a newsletter

  1. Open the saved Email placement (create one) and its Ad tags & API → Email tab. It generates exactly this markup, with your domain and key:

    <a href='https://<ad-serving-domain>/admlclck?key=<placement-key>&rand=<SET_UNIQUE_AD_ID_HERE>'>
    <img src='https://<ad-serving-domain>/adml?key=<placement-key>&rand=<SET_UNIQUE_AD_ID_HERE>'/>
    </a>

    Email tab of the Ad tags & API card with the generated image-plus-link snippet

  2. Replace rand=<SET_UNIQUE_AD_ID_HERE> with a value unique per sent email — a merge tag or message id from your sending platform. Both URLs must carry the same value within one email. The same two URLs are also available separately as the read-only Creative URL and Landing page URL fields directly under the code block.

  3. Paste the snippet into the newsletter template and send a test to yourself: the image should show a creative, and the link should land on that creative’s page.

Mail tags from the site: Email ad tags

The site editor’s header Actions → Email ad tags opens a mailing dialog that covers all the site’s placements, not just email ones:

  1. Open Account → Publishers → site → Actions → Email ad tags. The dialog is titled Ad tag mailing settings, and the grid’s first column is headed Publisher/Zone/Placement.

    Ad tag mailing settings dialog with the placement grid, the Emails field, Send as a single file and Send

  2. The dialog shows the site’s zone → placement tree as a grid: one row per placement, one checkbox column per tag type. A checkbox renders only where the tag type applies to that placement’s type, and each placement’s default tag type comes pre-checked. Select all / Deselect all work across the whole tree.

  3. Fill the mailing fields: Emails(comma separated) (pre-filled with the site’s contact email, or the site owners’ emails when it has none). From is read-only: the mail always goes out from your own account’s address. Under More details, Subject and HTML Body arrive pre-filled from the Send invocation code template; edit them to send something custom.

  4. Choose the packaging: with Send as a single file on (the default) all selected codes go into one .txt attachment separated by per-placement comment headers; off, each placement×tag-type pair becomes its own .txt attachment.

  5. Click Send. Each recipient gets their own email built from the network’s Send invocation code template.

Caveats and exceptions

Who can do this. Reading a tag from the placement editor needs only view access on the site — a publisher copies the email code from the placement’s Email tab, and a Can View share keeps the tab and its URLs copyable. The site-level mailing dialog needs the Email Invocation Codes permission, an editable site, and a network that has the Send invocation code email template — without the template the Actions entry does not exist at all, for anyone. The administrator configures that template. Exact grants: User roles.

What the two URLs do. The <img> is the impression request: when the mail client fetches it, the ad server picks a banner for the placement, logs a CPM impression and redirects to the creative’s image file. If nothing is eligible to serve, it returns a transparent 1×1 PNG so the email never shows a broken image. The <a> is the click link: it logs the click and redirects to the click-through URL of the same banner the image showed.

How impression and click stay in sync. The rand value is the glue: on the image fetch the server remembers “placement + this rand → banner X” for 24 hours; the click with the same rand looks that pairing up and redirects to banner X’s landing page. Without it, the click would re-run banner selection and could send the reader to a different advertiser than the one whose creative they saw. A reader who opens the email today and clicks next week triggers a fresh lookup: the click cannot resolve the shown banner and the link goes nowhere. Reopening the email (re-fetching the image) refreshes the pairing.

Leave the placeholder in and attribution breaks. If <SET_UNIQUE_AD_ID_HERE> stays literally in the sent email, every recipient shares one pairing key — the first image fetch fixes the banner, and everyone’s clicks resolve against whatever banner was cached last. Stats still count, but click attribution across recipients becomes meaningless.

The serving domain comes from the placement’s Domain selection (falling back to the network’s default tag domain, and to the system default ad-serving domain only on a network with no tag domain configured) and is always https. The markup uses the short /adml and /admlclck paths — the legacy aliases of /ads-mail and /ads-mail-click — and both stay mapped precisely because emails already sent can never be updated. The same logic applies to the domain: never retire a domain used in sent newsletters.

Default parameters travel with the snippet. It carries a $allDefaultUrlParams token on both URLs, right after the rand value, which resolves to whatever default tag parameters the placement carries (channel, custom parameters, click, the pass-through privacy signals from the Settings tab) — empty on a fresh placement, not empty the moment someone adds a default. If you keep a copy of the tag somewhere, re-copy it after changing those defaults.

Sending with nothing ticked “succeeds” and mails nothing. The dialog only validates the From and recipient addresses, and the server only does any work when the selection is non-empty — so the dialog closes on a success that never produced an email.

The send is permission-filtered per tag type on the server. A tag type you ticked but have no permission for is silently skipped from the sent mail — no error, the email just lacks that attachment or section. Deleted placements are skipped the same way.

Every ticked placement must be on a site you can view. If one is not, nothing is sent at all and the dialog reports a permission error — the check is not per placement.

Not working?

SymptomCheckWhere
Clicks land on a different advertiser than the one shown<SET_UNIQUE_AD_ID_HERE> was left in, or the two URLs carry different rand valuesThe sent mail’s source — one merge tag, on both URLs
A click goes nowhereMore than 24 hours passed since the last image fetch, so the pairing expiredReopen the mail (re-fetch the image), then click
The image is a blank 1×1Nothing was eligible to serve — no linked banner, targeting, capping or limitsThe placement’s Linked banners; My ad is not serving
Custom parameters or channel missing from the requestsThe snippet was copied before the defaults were addedRe-copy it from the Email tab
No Email ad tags entry under ActionsThe network has no Send invocation code email template (a configuration, not a permission), the site is not editable, or your role lacks Email Invocation CodesAdmin: the email templates first, then Roles
The dialog closed but no mail arrivedNothing was tickedTick at least one checkbox before Send
The mail lacks an attachment or sectionYour role lacks the permission for that tag type, or the placement was deletedRoles, per tag type
The dialog reports a permission error and sends nothingOne ticked placement is on a site you cannot viewUntick it, or get view access to that site
The API answers 400 on sendA placement of another site or a tag type you cannot generate was passed, or the network has no template and subject / body were not both sentThe request parameters

Reference

ItemValue
Image (impression) URLhttps://<ad-serving-domain>/adml?key=<placement-key>&rand=<unique> — alias of /ads-mail; a transparent 1×1 PNG when nothing serves
Click URLhttps://<ad-serving-domain>/admlclck?key=<placement-key>&rand=<unique> — alias of /ads-mail-click
randA value unique per sent email, identical on both URLs; the impression→click pairing lives 24 hours after the last image fetch
Fields under the snippetCreative URL, Landing page URL (read-only, Email tab)
Mailing dialogAd tag mailing settings: grid Publisher/Zone/Placement × tag types; Emails(comma separated); From read-only; More details → Subject, HTML Body; Send as a single file (default on)
PermissionsEmail Invocation Codes + an editable site + the Send invocation code template (dialog); view access on the site (Email tab, API)

Over the API

The same listing and mailing are available under /rest-api; both need view access to the site (all inventory, or a share on this site).

  • GET /rest-api/sites/{siteId}/invocation-codes.do lists the site’s live placements, zone by zone: {success, total, data: [{zoneId, zoneName, placementId, placementName, placementType, codeTypes}]}. codeTypes is what you may generate for that placement — the tag types its placement type offers, minus those your role lacks the per-type permission for. Page with start (default 0) and limit (1–1000, default 50). A deleted or missing site is 404.
  • POST /rest-api/sites/{siteId}/invocation-codes/send.do mails them. Parameters: emails (repeat it, 1–20 addresses), placementInvocationCodes[<placementId>] (the tag types to send for that placement, e.g. placementInvocationCodes[4001]=AJAX,DIRECT_URL), and optionally subject, body, singleFile (default true) and bccAuthor. The response is {success, recipients}.

The API is stricter than the dialog about what it will send: a placement of another site or a tag type you cannot generate is a 400 rather than a silent skip, and a missing or deleted placement is a 404. On a network with a Send invocation code template, subject and body replace the template’s own. A network with no such template still mails the codes when the call sends both subject and body — a plain message with the codes attached; without them it answers 400, where the dialog simply is not offered. There is no from parameter — like the dialog, the mail always goes out from the calling user’s address. Each send is recorded in the action log.

Related pages

Please disable Adblock
Are you using adblock? Disable it and reload the page to proceed to the destination page.

A registration has already been submitted from this page. Please try again in 10 minutes.