Landing-page SDK
Keep the click ID on your landing page and join parallel-tracking clicks by gclid.
2 min read
Browse documentation
The landing-page SDK is a small script (ES5, no dependencies) served from your tracking domain. It keeps the click ID available on your landing page, joins Google Ads parallel-tracking clicks by gclid, records direct visits, and fires conversions from the browser.
Install#
Add the script to every page of your landing site, before the closing </body> tag:
<script async src="https://track.example.com/sdk.js" data-offer="OFFERCODE"></script>How the click ID is found#
When the page loads the SDK looks, in order, for:
- a click ID in the page URL (
data-param,click_id,transaction_idortid); - a Google click ID (
gclid,gbraidorwbraid) — the SDK asks the tracking domain for the click recorded by the tracking template (this is how parallel tracking is joined); - a click ID stored earlier on this site (local storage and a first-party
atk_cidcookie, kept for 30 days); - otherwise, if
data-offeris set, a direct click is recorded for the offer.
JavaScript API#
<script>
window.ArcTrack = window.ArcTrack || [];
// Calls are queued until the script has loaded:
ArcTrack.push(["conversion", { event: "sale", amount: "49.90", txid: "ORDER-1001", currency: "USD" }]);
</script>Conversions fired by the SDK are pixel conversions, so the offer's conversion method must allow pixels.
Passing the click ID on#
The SDK rewrites links on the page so the click ID travels to your checkout or sign-up domain:
- any link whose
hrefcontains{click_id}gets the macro replaced; - any link with a
data-atkattribute getsclick_id=<id>appended (or the parameter named indata-atk).
<a href="https://checkout.example.com/buy?ref={click_id}">Buy now</a>
<a href="https://app.example.com/signup" data-atk="aid">Sign up</a>The /lp endpoint#
The SDK talks to POST https://track.example.com/lp with a JSON body
{click_id? and receives {"click_id":"…"}. You can call it
from your own code if you do not use the script. CORS is open and the request needs no credentials.
Privacy#
The SDK stores only the random click ID on your domain. Mention it in your website's cookie notice and ask for consent where your local law requires it.