Home
Offers & Tracking
Tracking Fundamentals
Understanding Tracking With The JavaScript SDK
Understanding Tracking With The JavaScript SDK

SERIES:

Understanding Tracking With The JavaScript SDK

Learn how to implement precise tracking with Everflow's JavaScript SDK, capturing clicks, conversions, and impressions directly on your web pages to optimize marketing performance and gain deeper campaign insights.

Overview

In the dynamic landscape of digital marketing, precise and efficient tracking is crucial. Everflow's JavaScript SDK offers a powerful solution for seamless integration and enhanced data collection directly on your web pages. This lightweight tool empowers you to capture valuable user interactions and conversions with greater accuracy and flexibility.

Let's explore how the JavaScript SDK can simplify your tracking processes and provide deeper insights into your campaign performance within the Everflow platform.

Already know what JS SDK is? You can skip this article and proceed to the set-up. So for JavaScript SDK step-by-step implementation instructions, please read this guide.

What Can You Track With The JavaScript SDK?

When it comes to the JavaScript SDK, you’re able to track:

  1. Impressions - via the Impression Script
  2. Clicks - via the Click Script
  3. Conversions - via the Conversion Script
NoteImpressions are available as an add-on package, and you might not see the Impression Script unless you have the package turned on.

How Is Tracking With The JSDK Different From S2S Postbacks?

When it comes to S2S Postback Tracking Method, it is solely for tracking Conversion Events. Whereas the JavaScript SDK is able to track Impressions, Clicks & Conversion Events.

Another big difference is that the JavaScript SDK relies on First-Party Cookies being stored on the Advertisers webpage/app. If you’re looking for a Cookie-less solution, please check the S2S Postback Tracking Method.

How Does The Javascript SDK Work?

When using the JavaScript SDK you’ll generally use the Click Script & the Conversion Script together.

A Reminder On Linking Types

Conversions generally happen after Clicks, and it’s very important to first select your Click Tracking type.

If you haven’t decided on the types of Click Tracking, here’s an introduction to the concept.

The JavaScript SDK can be used with both Linking Types, even though it’s generally paired with Direct Linking. In order for Direct Linking to work, you are required to use the JavaScript SDK’s Click Script.

Tracking Clicks

In order to understand any Conversion Tracking Method, we need to understand Clicks. As mentioned above, the JavaScript SDK provides a Click Script. The Click Script is essential when using Direct Linking, but also supports tracking with Redirect Links.

For a complete breakdown of the Click Script and its macros, please refer to this guide.

The simple idea is, once a Click has happened, that Click will generate a Transaction ID. This Transaction ID, will be associated with a Partner (usually an Affiliate), and an Offer.

Standard Everflow Click Script

This is a standard Everflow click script that includes all available parameters:

The implementation varies depending on your tracking setup.

Below are the specific configurations for different scenarios:

Direct Links Only

Direct Links require this script with the offer ID and affiliate ID parameters:

How Direct Linking Works:

Since Direct Linking needs the Click Script to record the Click, here's how this scenario works:

Here's a primer on Direct Linking if you're not familiar with how it works.

With Direct Linking, the visitor clicks on the Tracking Link and is directly brought to the Default Landing Page URL on the Advertiser's webpage/app.

Once they land on the Default Landing Page:

  1. The Advertiser fires off the Click Script when the visitor lands on the Default Landing Page
  2. The Click Script fetches the Offer ID & Affiliate ID from the URL parameters (&oid=OFFER_ID&affid=AFFILIATE_ID), and sends them to Everflow
  3. Everflow generates a Transaction ID (TID) and records a Click
  4. The Everflow server returns the TID as the response and sets a First Party Cookie with the TID

A click will be created in Everflow because &oid=OFFER_ID&affid=AFFILIATE_ID communicates with the click script. It will place Everflow first party cookies on the destination URL.

Direct Links + Redirect Links Combined

When using both Direct Links and Redirect Links together, this script is required with the transaction ID parameter:

Heads Up! The following parameter/macro needs to be added to the Default Landing Page URL:
&_ef_transaction_id={transaction_id}

Default Landing Page URL example:

How Redirect Linking Works

Redirect linking works differently from Direct Linking.

Here's a primer on Redirect Linking if you're not familiar with how it works.

Once a visitor clicks on a Redirect Link and lands on the Default Landing Page, the URL will have the Transaction ID parameter appended to it if &_ef_transaction_id={transaction_id} is included on the default landing page URL. The Click has already been recorded before reaching the Default Landing Page.

In this case:

  1. The Advertiser fires off the Click Script when the visitor lands on the Default Landing Page
  2. The Click Script will fetch the Transaction ID from the URL parameters (&_ef_transaction_id={transaction_id}), sending them to Everflow
  3. Everflow sees that a TID has been received in the call, and knows that the Click has already been recorded
  4. The Everflow server returns the TID as the response and sets a First Party Cookie with the TID
Heads Up! If a redirect link is used to send a click, the click script will not place a first party cookie unless &_ef_transaction_id={transaction_id} is included on the default landing page URL. (A click will still track, but it won't be added to the cookie.) When the transaction ID is present, the click script will recognize it in the URL and add the first party cookie with that transaction ID.

Tracking Conversions

The conversion tracking process is straightforward and works with any of the above click script configurations.

Here's how it functions:

  1. The Advertiser fires off the Conversion Script when the visitor converts (e.g., makes a purchase)
  2. The Conversion Script looks for the TID in the First Party Cookie set by the Click Script earlier, and sends the TID as well as Offer ID or Advertiser ID (depending on the config) to Everflow
  3. Everflow servers use the above information to record a Conversion and associate it with the correct Click, Affiliate, Offer & Conversion Event
For a complete breakdown of the Conversion Script and its macros, please refer to this guide.

The underlying principle is that the click script creates a first-party cookie on the site:

  • If a direct link is used, the oid & affid parameters are used to create it
  • If a redirect link is used, the default landing page URL needs to include &_ef_transaction_id={transaction_id} to create it

That is the entire process of tracking Clicks & Conversions with the JavaScript SDK.

Advanced Configurations & Troubleshooting

The configurations below cover additional scenarios you may encounter when implementing the Everflow JavaScript SDK, along with the most common issues and how to resolve them. They build on the standard Click and Conversion Script setups described above.

Using Server Postback As The Conversion Method With The JavaScript SDK

You can track Clicks with the JavaScript SDK (using Direct Linking) while tracking Conversions through a Server-to-Server (S2S) Postback rather than the Conversion Script. The Server Postback Conversion Method can be selected even when the JavaScript SDK is used to record the Click.

At a high level, this setup works as follows:

  1. Place the Click Script on the landing page (in the header or footer).
  2. Capture the Transaction ID generated by the Click Script.
  3. Fire the Advertiser Postback using that captured Transaction ID when the Conversion happens.

Capturing The Transaction ID On Form Submits

A common way to capture the Transaction ID for a later Server Postback is to store it in a hidden field on a form. When the form is submitted, the Transaction ID is collected alongside the rest of the form data, making it available to send back in the Postback.

Heads Up! This approach depends on how a given site or form is built, and should always be confirmed by the website’s web developer before relying on it.

First, add a hidden field to the form. In this example, REPLACE is used as both the field id and a placeholder you will substitute — you may use another naming format as long as it matches the script below:

Then use this Click Script, which writes the Transaction ID into the hidden field once the Click is recorded. Replace YOUR-TRACKING-DOMAIN, INSERT_ADVERTISER_ID, and each instance of REPLACE with your own values:

The collected field value then needs to be stored on the server so it can be passed back in the Server Postback.

Resolving Script Load-Order (Async) Issues

If a Click or Conversion does not track, one common cause is the JavaScript SDK library loading after the Click or Conversion Script runs. When that happens, the EF methods are not yet available when called.

To resolve this, load the SDK library dynamically and only fire the Click (or Conversion) once the library has finished loading. Replace the default scripts with the versions below.

Click Script:

Conversion Script:

Fixing “Syntax Error” Caused By Smart Quotes

If the browser console shows a JavaScript Syntax Error, a frequent cause is “smart quotes” (also called curly or typographer’s quotes). Some word processors and text editors automatically convert straight quotation marks ( " or ' ) into curly ones, which are not valid in JavaScript.

Replace any curly quotes in the script with regular straight quotes. You can also disable automatic smart-quote substitution in your editor:

  • Word (Windows): File → Options → Proofing → AutoCorrect Options → AutoFormat As You Type → toggle “Straight quotes with smart quotes”.
  • Word (macOS): Word → Preferences → AutoCorrect → AutoFormat As You Type → toggle “Straight quotation marks with smart quotation marks”.
  • Pages (macOS): Edit → Substitutions → turn off Smart Quotes.

Confirming Parameter Names Match The URL

Each EF.urlParameter() call must reference the same query-string parameter name that actually appears in the URL. For example, EF.urlParameter("oid") only works if the URL contains &oid=. A mismatch here is a common reason a Click fails to record.

When The Destination URL Contains A “#”

Anything after a # (hash/fragment) in a URL is not treated as a URL parameter, so the standard Click Script may not be able to read the oid and affid values. If your landing page URL places these parameters after a #, they need to appear before the # for the SDK to pick them up.

Heads Up! Before changing the position of parameters in a destination URL, confirm with the website owner that the change will not break the page, since some single-page applications rely on the fragment.

Additional Click Script Options

Attributing Organic Traffic To A Default Partner

If you want to track Partner Clicks but also attribute organic Clicks (those arriving without an affiliate ID) to a specific Partner, you can supply a fallback affiliate ID. Only the Click Script needs to change — the Conversion Script stays the same, because Conversions are matched using the first-party cookie / Transaction ID. Replace INSERT_DEFAULT_AFFILIATE_ID with the Partner you want to credit:

Passing A Media Cost On The Click

You can include a cost value on the Click Script, and Everflow will treat it the same way it does for Redirect Offers:

Configuring A Top-Level Domain And Organic Tracking

The EF.configure() method lets you set a top-level domain (so the first-party cookie is shared across subdomains) and define default organic offer and affiliate IDs for traffic that arrives without tracking parameters:

Passing Additional Values On A Conversion

The Conversion Script supports a parameters object, which you can use to send additional values that are not part of the default payload — such as a currency or a timestamp. Currency values use the standard three-letter code (for example, USD or EUR):

NoteThe Order ID can only be passed through an Everflow integration, not through the JavaScript SDK directly.

Using The SDK Without Fingerprinting (Vanilla)

The JavaScript SDK is “vanilla” (without fingerprinting) by default for newer accounts. Removing fingerprinting makes the SDK significantly lighter. For older accounts, you can switch to the vanilla library by pointing the script source to:

Troubleshooting Checklist

If Clicks or Conversions are not appearing in Everflow, work through the checks below. Most issues are caused by the script not being present, loading in the wrong order, or a parameter mismatch.

If A Click Is Not Tracking

  1. Confirm the tracking domain is verified — the SDK scripts will not run on an unverified domain.
  2. Confirm the Click Script is actually present on the landing page. In your browser’s developer tools, open the Elements tab and search for EF.click.
  3. Open the Network tab, load the page, and filter the requests by effp to confirm the Click call is being sent and returns a status of 200.
  4. Check the Console tab for any JavaScript errors related to the script (for example, a missing SDK library reference or a syntax error).
  5. Confirm each EF.urlParameter() name matches the corresponding parameter in the URL.
  6. In the Application tab, open Local Storage for the site and confirm a key containing a Transaction ID has been set. If none is present, the first-party cookie was not stored.
  7. Confirm the Partner is approved for the Offer and the Offer is active — a Click can be recorded as invalid if it is over cap, fails targeting, or the Partner is not approved.
  8. Note that Test tracking links do not contain an Offer ID or Affiliate ID and will not trigger the SDK script.

If A Conversion Is Not Tracking

First confirm that Clicks are tracking correctly using the steps above, then check the following:

  1. Confirm the Conversion Script is present on the Conversion page. In the Elements tab, search for EF.conversion.
  2. Confirm the SDK library is loaded before the Conversion Script runs (see the load-order section above).
  3. Generate a Conversion with the Network tab open, filtered by effp. A response of 204 means the Conversion was not registered.
  4. Confirm a valid first-party cookie / Transaction ID exists in Local Storage and that it corresponds to the correct Offer or Advertiser.
  5. Confirm the event_id or adv_event_id being passed matches an event configured on the Offer.
  6. Check the Console tab for JavaScript or syntax errors related to the script.
NoteWhen using an e-commerce platform integration (such as Shopify), the Click Script may not be visible directly on the page, since the integration handles it for you.