Skip to content

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

In the campaign settings, add the click_id parameter to your landing page URL:

http
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>):

html
<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:

html
<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:

html
<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:

EventMeaningHow it fires
level0Landing page view (traffic-quality beacon)Automatic, ~2.5s after page load, once per click
level1Primary conversion (registration, lead, click on CTA)trackConversion() — the default
level2Deeper action (qualified lead, deposit, purchase)trackConversion('level2')
level3Highest-value action (repeat purchase, upsell)trackConversion('level3')
javascript
// 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).

javascript
TGAdsTracker.trackConversion();                    // level1
TGAdsTracker.trackConversion('level2');            // level2

bindCTA(selector, eventType?)

Binds conversion tracking to clicks on elements matching a CSS selector:

javascript
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:

javascript
TGAdsTracker.trackEmail('[email protected]', 'level2');

getParam(name)

Helper that reads a query-string parameter from the current URL:

javascript
var subId = TGAdsTracker.getParam('sub_id');

Script Tag Options

All options are set via data-* attributes on the script tag:

AttributeDefaultPurpose
data-ctaCSS selector of CTA elements; clicks fire a conversion automatically
data-eventlevel1Event level used by data-cta clicks
data-dedupe1Set to 0 to allow sending the same event level more than once per click
data-level01Set to 0 to disable the automatic landing-view beacon

Example:

html
<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 (or tg_click_id / cl) from the landing page URL and stores it for 30 days (localStorage with 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 with data-dedupe="0" if your campaign counts repeat conversions.
  • Delivery. Events are sent with navigator.sendBeacon with image-pixel and fetch fallbacks, 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.

html
<!-- 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.

html
<!-- 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

  1. Open your landing page with a test click ID: https://yourwebsite.com/landing?click_id=test-123
  2. Open browser DevTools → Network tab, filter by conversion.
  3. Trigger your conversion action — you should see a request to go.atechspace.live/conversion with click_id=test-123 and your event_type.
  4. 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.