Skip to main content

Direct Linking

Send users straight to the advertiser's page without a tracking-link redirect, while keeping full attribution and payouts with the Swaarm JS SDK.

Direct linking lets publishers send users straight to the advertiser's page, without a redirect through a Swaarm tracking link. The click is registered by the Swaarm JS SDK on the advertiser's page instead, so you keep full attribution, sub IDs and payouts while the ad points directly at the advertiser's domain.

ℹ️ Direct Link only appears for an offer that has a Preview URL. If you don't see it, check the offer's Preview URL first.


When to use it

  • Ad platforms that don't allow redirects, or that require the ad's destination URL to match the advertiser's domain (for example Google Ads, Microsoft Ads, Meta).

  • Faster landing pages, as there is no extra redirect between the ad and the advertiser's page.

  • Advertisers who prefer their own URL to be visible in links and ads.


Requirements

  • The offer has a Preview URL (or the landing page you want to use has one). The direct link is built from it.

  • The advertiser can add a small JavaScript snippet to their website: to the landing page and to the pages where conversions happen.

  • The landing page and the conversion pages run on the same domain.

Limitations

⚠️ Same browser, same domain. The click ID is stored in the user's browser for the website's domain. Conversions are only attributed when they happen in the same browser and on the same domain as the landing page. www.advertiser.com and advertiser.com count as different domains, and so does a checkout hosted on a different domain. In those cases, fire the conversion server-side with the postback URL instead.

  • Browser blockers. Ad and script blockers can stop the SDK from loading. Those users can't be tracked through a direct link.

  • Security token. When the advertiser has a security token, it is part of the snippet and therefore visible in the page source. If that's a concern, send monetary events from the advertiser's server using the postback URL.

  • Google publishers. Direct Link is not offered for publishers set up with the Google integration. They keep using their regular tracking links.


Step 1 - Get the direct link (Offers → Publishers tab)

  1. Go to Offers and open the offer.

  2. In the lower part of the offer page, open the Publishers tab.

  3. On the row of the publisher, click the ⋮ menu.

  4. Choose Direct Link:

    • Copy copies the publisher's direct link to the clipboard.

    • Configure opens the direct link dialog with the setup instructions for the advertiser.


The Configure dialog

Element

Notes

The direct link

Shown at the top, ready to copy. It is the offer's Preview URL plus the publisher's tracking parameters, for example https://advertiser.com/landing?offer_id=10&pub_id=20.

Landing Page

Choose one of the offer's landing pages to link to that page's Preview URL instead. The link then also carries lp_id, so clicks are reported against that landing page.

Setup instructions for the advertiser

Prefilled for this offer: your tracking domain, the advertiser's security token (if it has one), and one line of code for each event of the offer.

Send the setup instructions to the advertiser as they are. Copy & Close copies the direct link.


Step 2 - Set up the advertiser's website

The Configure dialog generates the snippets below with the right values for the offer. They are shown here with example values.

2.1 Add the SDK to the advertiser's pages

Add this to the landing page and to every page where a conversion can happen:

html

<script src="https://cdn.jsdelivr.net/gh/swaarm/swaarmjs@master/dist/swaarm.min.js"></script> <script>   Swaarm.initialize({     trackingUrl: "https://track.yourcompany.swaarm-clients.com",     securityToken: "abc123" // only when the advertiser has a security token   }); </script>

2.2 Register the visit on the landing page

js

Swaarm.land();

This registers the click with all the parameters of the direct link and remembers it in the user's browser for the events that follow.

2.3 Fire the events

Call the matching line when the user completes each action:

js

// Conversion (default event) Swaarm.attribute();  // Registration Swaarm.event('registration');  // Purchase, with revenue Swaarm.event('purchase', { saleAmount: 25.50, saleAmountCurrency: 'USD' });

The name passed to Swaarm.event is the event's Advertiser Event ID in the offer's event settings.

⚠️ An event without an Advertiser Event ID can't be fired from the SDK, and the Configure dialog says so. Set the ID in the offer's event settings first.

Optional event details:

Option

Description

saleAmount

Revenue of the event, in the major unit (for example dollars, not cents).

saleAmountCurrency

Currency of saleAmount, for example USD or EUR.

originalSaleAmount / originalSaleAmountCurrency

Amount and currency of the original transaction, for example for crypto or in-game currencies.

aggregatedValue

A numeric, non-monetary value that Swaarm sums up in reports (for example levels completed).

customValue

A free-form value stored with the event.


Step 3 - Test the setup

  1. Turn on debug logging: add debug: true to Swaarm.initialize({...}).

  2. Open the direct link in a fresh browser window (or a private window).

  3. In the browser console you should see the click request, followed by Saving clkid ….

  4. Complete a conversion on the site. The console shows the postback request.

  5. In Swaarm, check that the click and the conversion appear in the offer's reports for that publisher.

Remove debug: true once everything works.


How it works

  1. Click. The user lands on the advertiser's page through the direct link, for example advertiser.com/landing?offer_id=10&pub_id=20&pub_sub_id=abc. Swaarm.land() reads the parameters from the page URL and registers the click in Swaarm. Swaarm returns a click ID, which the SDK stores in the user's browser.

  2. Conversion. When the user completes an action on a later page (for example /signup or /checkout), Swaarm.attribute() or Swaarm.event(...) sends the conversion for the stored click ID.

  3. Everything else works as usual. Swaarm attributes the conversion to the offer and publisher, applies payouts and fires the publisher's postbacks. Fraud and validation rules, caps, reports and postbacks treat these clicks and conversions exactly like those from regular tracking links.

ℹ️ If a user arrives through a regular Swaarm tracking link instead, the advertiser's page already receives the click ID (clkid) in the URL and Swaarm.land() simply stores it. The same setup works for both kinds of links, so the advertiser only has to integrate once.


Parameters captured from the link

Swaarm.land() automatically picks up every Swaarm parameter in the landing page URL, using the same names and aliases as Swaarm tracking links. These include:

Group

Parameters

Offer and publisher

offer_id, pub_id, pub_sub_id, pub_sub_sub_id, pub_click_id, site, placement, creative, unique1 … unique19

Campaign structure

campaign_id, campaign, adset_id, adset, ad_id, ad, term

Ad network click IDs

gclid, wbraid, gbraid, fbclid

Device IDs

idfa, gaid, idfv

User information

user_id, user_email, user_phone, and the other user_* fields

On top of that:

  • UTM tags fill in missing values: utm_campaign → campaign, utm_adset → adset, utm_ad → ad, utm_source → site, utm_term → term.

  • The publisher click ID: the first of gclid, fbclid, ttclid, wbraid, gbraid becomes pub_click_id when the link has none.

Publishers can therefore append their usual parameters to the direct link, the same way they do with tracking links:

https://advertiser.com/landing?offer_id=10&pub_id=20&pub_sub_id={your_sub_id}&gclid={gclid}

Overriding parameters

The advertiser can set or replace parameters in code. A null value removes a parameter:

js

Swaarm.land({   pub_sub_id: "homepage-banner", // replaces the value from the URL   gclid: null                    // don't send the gclid });

Swaarm.params() returns the parameters that would be sent for the current page, which is handy for checking a setup.


FAQ

  • Do I still need the tracking link? - No, a publisher can use either link. Advertisers who installed the SDK track both kinds of traffic with the same setup.

  • Does the direct link change payouts, caps or targeting? - No. Direct link clicks are registered through the same tracking pipeline as tracking-link clicks, with the same rules, caps and payouts.

  • Where does a user end up when the click is blocked by a rule? - They stay on the advertiser's page, because there is no redirect to stop. The click is still evaluated by the same rules as a tracking-link click and is reported with its outcome.

Did this answer your question?