Node SDK
This Node.js SDK is designed to track user interactions, such as clicks, impressions, conversions and other events, on your web applications
Get started
To start tracking using Offer18's Node SDK, you'll need to integrate the SDK into your web application as a node module.
Find out latest stable version of Node Package
Installation
You can install the package using npm:
or
Usage
Import
Initialize
Available Methods
Conversion flow
The conversion flow is the sequence in which only conversions will be tracked by the Node SDK. To implement the conversion flow, After initializing the SDK, you need to add methods in the following order::
Placement : Page load or after the component mounts
then
Placement : Thank you Page/Order Success Page
Know more about YOUR-CLICK-ID-PARAMETER & options in Method Overview
SDK flow
The SDK flow is the sequence that allows users to track the entire conversion process in the Node SDK, including tracking impressions, clicks, and conversions. After initializing the SDK, you need to add methods in the following order:
Placement : Page load or after the component mounts
then
Placement: Can be placed on all pages (on page load or after the component mounts)
then
Placement : Thank you Page/Order Success Page
Know more about options in Method Overview
Method Overview
initializeConversion('YOUR-CLICK-ID-PARAMETER')
This method is used to initialize the conversion. You need to add this method either on page load or after the component mounts.
Replace YOUR-CLICK-ID-PARAMETER with the parameter key that is used to accept the value from the {tid} token in the offer URL.
trackClick(options)
This method is utilized for tracking clicks.
Parameters:
options
(object): Configuration options.
Parameter | Type | Description |
---|---|---|
| string | Mandatory: Tracking URL which can be extracted from Offer18 dashboard |
| array | An array of Offer18 parameters and Native parameters in the format |
Example code
trackImpression(options)
This method is utilized for tracking impressions.
Parameters:
options
(object): Configuration options.
Parameter | Type | Description |
---|---|---|
| string | Mandatory: Tracking URL which can be extracted from Offer18 dashboard |
| array | An array of Offer18 parameters and Native parameters in the format |
Example code
trackConversion(options)
This method is utilized for tracking conversions.
Parameters:
options
(object): Configuration options.
Parameter | Type | Description |
---|---|---|
| string | Mandatory: Postback domain of the user. |
| string | Mandatory: Offer18 account id of the user. |
| string | Mandatory: Id of the campaign. |
| string | Coupon code can be used here. |
| string | It can be either 'iframe' or 'pixel', default value is 'iframe'. |
| boolean | User can configure global pixel by setting this true, default value is false. |
| boolean | User can allow MultiConversion by setting this true, default value is false. |
| object | This object contains the parameters which can be used to get values from the network. |
conversionData Object
Parameter | Type | Description |
---|---|---|
| string | Event Name (Please specify the event) |
| string | Payout Amount (Please specify the payout amount) |
| string | Sale Amount (Please specify the sale amount) |
| string | Currency code |
| string | Advertiser sub parameter 1 |
| string | Advertiser sub parameter 2 |
| string | Advertiser sub parameter 3 |
| string | Advertiser sub parameter 4 |
| string | Advertiser sub parameter 5 |
Example code
clearCookies()
This method is utilized for removing all first-party cookies added by this package.
activateDebugMode()
This method is utilized for enabling the logger. Logs of every action performed by this package will be visible in the browser's developer tools console. You need to add this method immediately after initializing the SDK
Last updated