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.
What Can You Track With The JavaScript SDK?
When it comes to the JavaScript SDK, you’re able to track:
- Impressions - via the Impression Script
- Clicks - via the Click Script
- Conversions - via the Conversion Script
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.
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.
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:
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:
- The Advertiser fires off the Click Script when the visitor lands on the Default Landing Page
- The Click Script fetches the Offer ID & Affiliate ID from the URL parameters (&oid=OFFER_ID&affid=AFFILIATE_ID), and sends them to Everflow
- Everflow generates a Transaction ID (TID) and records a Click
- 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:
&_ef_transaction_id={transaction_id}
Default Landing Page URL example:
How Redirect Linking Works
Redirect linking works differently from Direct Linking.
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:
- The Advertiser fires off the Click Script when the visitor lands on the Default Landing Page
- The Click Script will fetch the Transaction ID from the URL parameters (&_ef_transaction_id={transaction_id}), sending them to Everflow
- Everflow sees that a TID has been received in the call, and knows that the Click has already been recorded
- The Everflow server returns the TID as the response and sets a First Party Cookie with the TID
Tracking Conversions
The conversion tracking process is straightforward and works with any of the above click script configurations.
Here's how it functions:
- The Advertiser fires off the Conversion Script when the visitor converts (e.g., makes a purchase)
- 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
- Everflow servers use the above information to record a Conversion and associate it with the correct Click, Affiliate, Offer & Conversion Event
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:
- Place the Click Script on the landing page (in the header or footer).
- Capture the Transaction ID generated by the Click Script.
- 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.
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.
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):
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
- Confirm the tracking domain is verified — the SDK scripts will not run on an unverified domain.
- 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.
- 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.
- Check the Console tab for any JavaScript errors related to the script (for example, a missing SDK library reference or a syntax error).
- Confirm each EF.urlParameter() name matches the corresponding parameter in the URL.
- 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.
- 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.
- 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:
- Confirm the Conversion Script is present on the Conversion page. In the Elements tab, search for EF.conversion.
- Confirm the SDK library is loaded before the Conversion Script runs (see the load-order section above).
- Generate a Conversion with the Network tab open, filtered by effp. A response of 204 means the Conversion was not registered.
- Confirm a valid first-party cookie / Transaction ID exists in Local Storage and that it corresponds to the correct Offer or Advertiser.
- Confirm the event_id or adv_event_id being passed matches an event configured on the Offer.
- Check the Console tab for JavaScript or syntax errors related to the script.