Skip to content

Data buffer and tokens

When a visitor opens a tracking link, its URL usually carries many parameters: the campaign and ad ids written by the ad platform, a click id, maybe a sub-id of an affiliate, a keyword. amabledata sorts them into two groups:

  • Tracking fields: the parameters declared in the traffic source. They are stored on every touch of the visit and appear in reports.
  • The data buffer: every other parameter. It is kept only while the click is being routed, so you can forward values to your pages, webhooks and destination URLs with tokens, and is then thrown away. It is never stored.

You forward values by adding Data parameters to page groups and external URLs, and by writing tokens such as {hit}, {campaign} or {data-keyword} in their values, in webhook URLs, headers and bodies.

  1. Reserved parameters are set aside. vid, n, c, ts, f, p, hit, rev, tx and rn belong to the link routes (visitor id, node, cost, direct-link ids, postback values, origin node). They are never captured, never forwarded by data passing and can never be used as tracking field or data parameter names (case-insensitive).

  2. Tracking fields are captured. For the traffic source of the link, the edge reads the URL parameter of the campaign field, the external click id field and each custom field (c1 … c20). Empty values are ignored. Values are cut at 255 characters for the campaign and 512 for the others.

  3. The data buffer is filled. Every non-reserved parameter whose name is 1 to 64 letters, digits, _, . or - goes into the buffer (the tracking fields too), up to 50 parameters, each value cut at 512 characters. When a name appears twice, the first value wins.

On an entrance (/go), the tracking fields come from the link and are saved in the visitor’s funnel session. On an action (/a/N), the tracking fields come from that session, so the pages after the first still know the campaign, the click id and the custom fields of the ad; the data buffer is filled with the parameters of the action link itself.

Data parameters are key/value pairs you add in the side panel of a node (Data parameters › Add parameter, then Key and Value; the × button removes a row). They exist on:

Where Applies to
Page group The URL of every page of the group
A page of a page group (API only) That page, overriding the group’s value for the same key
External URL The destination URL

The final URL is built in layers, the last layer winning when two layers set the same key:

  1. the parameters already in the page or external URL (kept as typed: tokens are not replaced there);
  2. for an External URL with Append tracking fields and data parameters on: the whole data buffer of the click;
  3. the node’s data parameters;
  4. the page’s data parameters;
  5. vid, set last to the visitor id (always on pages; on external URLs only with Append tracking fields and data parameters on).

Then, for pages, the page node id n is added if the URL has none.

Rules:

  • Tokens in data parameter values are replaced, then the value is URL-encoded.
  • Reserved keys (vid, n, c, …) are silently ignored in every layer except the URL you typed.
  • Up to 30 data parameters per node or page; keys of 1 to 64 letters, digits, _, . or -; values up to 512 characters.
  • A page group does not forward the incoming URL parameters on its own: add a data parameter for each value the page needs.

Example: a page group with the data parameters clickid = {hit}, kw = {data-keyword} and src = {trafficsource-id}, reached from

https://track.example.com/go/fg_abc-ts_def?campaign=987&keyword=running%20shoes

redirects to

https://www.example.com/offer?clickid=k2m3n4p5q6r7s8t9v2w3x4y5z6&kw=running%20shoes&src=ts_def&vid=0b6c…&n=n5

A token is a name between single braces: {name}. Names may contain letters, digits, _, . and -.

  • A known token whose value is missing becomes an empty string.
  • An unknown placeholder is left untouched. This is why ad platform macros such as {{campaign.id}}, {campaignid} or __CAMPAIGN_ID__ survive untouched in your links: the platform replaces them, not amabledata.
  • Encoding depends on where the token is used: URL-encoded in webhook URLs, JSON-escaped in webhook bodies (so "{campaign}" stays valid JSON), raw in webhook headers, raw then URL-encoded as a whole in data parameter values.
Place Replaced
Data parameters values (page groups, pages, external URLs) Yes
Webhook URL, header values and body Yes
The URL field of a page or external URL No: put dynamic values in Data parameters
Tracking field Source token No: it is the ad platform’s own macro, written into the generated links
Token Value
{hit} The hit id of the view of the destination page (26 lowercase letters and digits). Send it back in the postback hit parameter to credit a conversion to this exact view.
{visitor} The funnel visitor id (same as vid).
{campaign} The campaign captured by the traffic source’s campaign field.
{external} The external click id captured by the source (for example the platform click id).
{funnel-id} The funnel id (fg_…).
{trafficsource-id} The traffic source id (ts_…), empty when unknown.
{current-node-id} The id of the node being resolved: the page group or external URL for data parameters, the webhook node for webhooks.
{country} Visitor country, two-letter ISO code (empty when unknown).
{device} desktop, mobile or tablet.
{browser} Browser name, for example Chrome.
{os} Operating system name, for example iOS.
{c1} … {c20} The value of the custom tracking field stored in that slot.
{data-<name>} The tracking field called <name> (by its name in the source); if there is none, the URL parameter <name> of the data buffer. Example: {data-adset}, {data-gclid}, {data-sub1}.
{payout}, {txid} Conversion values; they are empty in funnel redirects and webhooks.

The Token column of the tracking fields table of a source shows the token of each field: {campaign} and {external} for the two reserved fields, {data-<field name>} for custom fields.

Forward the ad’s ids to your landing page

Section titled “Forward the ad’s ids to your landing page”
  1. In the traffic source, make sure the ids are tracking fields (for example adset and ad). See Traffic sources.

  2. In the builder, select the lander’s Page group.

  3. Under Data parameters, click Add parameter and enter Key utm_content, Value {data-ad}. Repeat for utm_term = {data-adset}.

  4. Save. Every visitor now lands on the page with utm_content and utm_term filled.

  1. Select the Offer page group and add the data parameter clickid = {hit} (not hit: that key is reserved and would be dropped).

  2. Have your checkout store the clickid value with the order.

  3. When the order is paid, call /pb?hit=<stored value>&rev=<total>&tx=<order id>. See Tracking links.

  1. Add an External URL node with the partner’s address.

  2. Keep Append tracking fields and data parameters on: every non-reserved parameter of the click and vid are appended.

  3. Add data parameters for the extra keys the partner expects, for example subid = {hit}.

  • Editing data parameters requires analytics:configure (owner, admin, marketer) to save the funnel.
  • Up to 50 URL parameters per click in the data buffer, values up to 512 characters.
  • Up to 30 data parameters per node or page.
  • The data buffer is never stored: only the tracking fields of the source are written to the click log. Do not rely on a buffer value being available on a later click unless it is a tracking field.
Symptom Cause Fix
A token appears literally in the page URL ({hit}) It was typed in the page URL field, where tokens are not replaced Move it to Data parameters
{data-keyword} is empty on the second page The data buffer only lives for one click; the second page is reached by an action link Declare keyword as a tracking field of the source: tracking fields are kept in the funnel session
A data parameter is missing from the URL Its key is reserved (vid, n, c, ts, f, p, hit, rev, tx, rn) Use another key, for example clickid instead of hit
A platform macro is left unreplaced in the landing URL The ad platform did not fill it (macro not supported by that placement) Check the macro name in the platform; amabledata never replaces platform macros
Values look double-encoded The value was already URL-encoded in the source Send raw values; amabledata encodes them once