Conversion Tracking with the Adexium Pixel (pixel.js)
The Adexium pixel is the easiest way to track conversions on your landing page — no backend integration required. Add one <script> tag and the pixel will automatically capture the click ID from the URL, report conversions, and collect traffic-quality signals that help us send you better traffic.
If you prefer server-to-server tracking (postbacks from your backend), see Conversion Tracking (Websites).
Quick Start
1. Configure the Campaign Link
In the campaign settings, add the click_id parameter to your landing page URL:
https://yourwebsite.com/landing?click_id=[CLICK_ID]The [CLICK_ID] macro is replaced automatically by Adexium. The pixel also recognizes the tg_click_id and cl parameter names.
2. Add the Pixel to Your Landing Page
Place the script tag before the closing </body> tag (or in <head>):
<script src="https://cdn.techtg.space/assets/js/pixel.js"></script>That's it — the pixel initializes itself and exposes a global TGAdsTracker object.
3. Report the Conversion
When the user completes the target action (signup, purchase, form submission), call:
<script>
TGAdsTracker.trackConversion();
</script>The pixel sends the conversion together with the stored click ID to Adexium. If the page was opened without a click ID (e.g. direct visit), the call is safely ignored.
No-Code Setup: Track Clicks on a Button
If your conversion is "user clicked the CTA button", you don't need to write any JavaScript. Point the pixel at your button with a CSS selector:
<script src="https://cdn.techtg.space/assets/js/pixel.js"
data-cta="a.cta-button"
data-event="level1"></script>Every click on an element matching a.cta-button fires a level1 conversion automatically.
Conversion Levels (Funnel Events)
The pixel supports multiple event levels so you can report the whole funnel, not just the first action:
| Event | Meaning | How it fires |
|---|---|---|
level0 | Landing page view (traffic-quality beacon) | Automatic, ~2.5s after page load, once per click |
level1 | Primary conversion (registration, lead, click on CTA) | trackConversion() — the default |
level2 | Deeper action (qualified lead, deposit, purchase) | trackConversion('level2') |
level3 | Highest-value action (repeat purchase, upsell) | trackConversion('level3') |
// Primary conversion
TGAdsTracker.trackConversion();
// Deeper funnel events
TGAdsTracker.trackConversion('level2');
TGAdsTracker.trackConversion('level3');Reporting level2/level3 events is optional but highly recommended: campaigns with funnel data get better traffic-quality optimization and access to Auto CPA bidding.
JavaScript API
trackConversion(eventType?, extra?)
Sends a conversion event. Returns true if the event was dispatched, false if there is no click ID or the event was already sent (deduplication).
TGAdsTracker.trackConversion(); // level1
TGAdsTracker.trackConversion('level2'); // level2bindCTA(selector, eventType?)
Binds conversion tracking to clicks on elements matching a CSS selector:
TGAdsTracker.bindCTA('#signup-button', 'level1');trackEmail(email, eventType?)
Reports a conversion tied to an email signup (default level3). The raw email address is never sent — only a short SHA-256 hash prefix, the domain, and a validity flag, so we can score signup quality without receiving any personal data:
TGAdsTracker.trackEmail('[email protected]', 'level2');getParam(name)
Helper that reads a query-string parameter from the current URL:
var subId = TGAdsTracker.getParam('sub_id');Script Tag Options
All options are set via data-* attributes on the script tag:
| Attribute | Default | Purpose |
|---|---|---|
data-cta | — | CSS selector of CTA elements; clicks fire a conversion automatically |
data-event | level1 | Event level used by data-cta clicks |
data-dedupe | 1 | Set to 0 to allow sending the same event level more than once per click |
data-level0 | 1 | Set to 0 to disable the automatic landing-view beacon |
Example:
<script src="https://cdn.techtg.space/assets/js/pixel.js"
data-cta="a.buy-now"
data-event="level1"
data-dedupe="1"></script>How It Works (Details)
- Click ID capture. On load the pixel reads
click_id(ortg_click_id/cl) from the landing page URL and stores it for 30 days (localStoragewith a cookie fallback). All conversions are attributed to that click — including conversions on later pages of your funnel where the URL no longer carries the click parameter. A fresh click always overwrites the stored one. - Deduplication. Each event level is sent at most once per click ID. The pixel remembers sent events in
localStorage, so a page refresh does not create duplicate conversions. Disable withdata-dedupe="0"if your campaign counts repeat conversions. - Delivery. Events are sent with
navigator.sendBeaconwith image-pixel andfetchfallbacks, so conversions are delivered reliably even if the user leaves the page immediately after clicking. - Traffic-quality telemetry. Together with each event the pixel sends anonymous behavioral and device signals (interaction counts, page visibility, screen size, timezone). These signals let Adexium filter bot traffic before it spends your budget — landing pages with the pixel installed get measurably cleaner traffic. No personal data (names, emails, cookies, identifiers) is collected.
Using with Google Tag Manager
If your site already runs GTM, you can install the pixel without touching the site code — two Custom HTML tags:
Tag 1 — load the pixel. Trigger: All Pages.
<!-- Adexium — load the pixel -->
<script src="https://cdn.techtg.space/assets/js/pixel.js"></script>The pixel captures and stores the click_id on the landing page, so it survives navigation to any other page of the funnel.
Tag 2 — fire the conversion. Trigger: your conversion event (form submit, button click, thank-you page view). Change level1 to level2 / level3 to match the goal.
<!-- Adexium — fire on your conversion trigger -->
<script>
(function () {
var t = window.TGAdsTracker;
if (t && t.clickId) {
t.trackConversion('level1');
return;
}
// fallback if the pixel has not loaded on this page
var id = ('; ' + document.cookie).split('; adx_click_id=').pop().split(';')[0];
if (id) {
new Image().src = 'https://go.atechspace.live/conversion?click_id='
+ encodeURIComponent(id) + '&event_type=level1';
}
})();
</script>Publish the GTM container after adding both tags. The pixel API path is preferred: it deduplicates repeat firings and attaches the traffic-quality telemetry described above.
Verifying the Integration
- Open your landing page with a test click ID:
https://yourwebsite.com/landing?click_id=test-123 - Open browser DevTools → Network tab, filter by
conversion. - Trigger your conversion action — you should see a request to
go.atechspace.live/conversionwithclick_id=test-123and yourevent_type. - Conversions appear in your Adexium dashboard statistics within a few minutes.
TIP
Deduplication persists in localStorage. When re-testing with the same click ID, either use a fresh click_id value or clear site data in DevTools.
Support
Questions about the integration? Contact us: @AdexiumSupportBot.
