Node SDK
This Node.js SDK is designed to track user interactions, such as clicks, impressions, conversions and other events, on your web applications
Last updated
This Node.js SDK is designed to track user interactions, such as clicks, impressions, conversions and other events, on your web applications
Last updated
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
You can install the package using npm:
or
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
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
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.
This method is utilized for tracking clicks.
Parameters:
options
(object): Configuration options.
trackingURL
string
Mandatory: Tracking URL which can be extracted from Offer18 dashboard
keymapping
array
An array of Offer18 parameters and Native parameters in the format <OFFER18-PARAMETER>:<YOUR-PARAMETER>
. User can replace <OFFER18-PARAMETER>
with Offer18 Parameters like aff_sub1
, aff_sub2
and <YOUR-PARAMETER>
with their parameters in which user is getting values from their network.
Example code
This method is utilized for tracking impressions.
Parameters:
options
(object): Configuration options.
impressionURL
string
Mandatory: Tracking URL which can be extracted from Offer18 dashboard
keymapping
array
An array of Offer18 parameters and Native parameters in the format <OFFER18-PARAMETER>:<YOUR-PARAMETER>
. User can replace <OFFER18-PARAMETER>
with Offer18 Parameters like aff_sub1
, aff_sub2
and <YOUR-PARAMETER>
with their parameters in which user is getting values from their network.
Example code
This method is utilized for tracking conversions.
Parameters:
options
(object): Configuration options.
domain
string
Mandatory: Postback domain of the user.
accountId
string
Mandatory: Offer18 account id of the user.
offerId
string
Mandatory: Id of the campaign.
coupon
string
Coupon code can be used here.
postbackType
string
It can be either 'iframe' or 'pixel', default value is 'iframe'.
isGlobalPixel
boolean
User can configure global pixel by setting this true, default value is false.
allowMultiConversion
boolean
User can allow MultiConversion by setting this true, default value is false.
conversionData
object
This object contains the parameters which can be used to get values from the network.
conversionData Object
event
string
Event Name (Please specify the event)
payout
string
Payout Amount (Please specify the payout amount)
sale
string
Sale Amount (Please specify the sale amount)
currency
string
Currency code
adv_sub1
string
Advertiser sub parameter 1
adv_sub2
string
Advertiser sub parameter 2
adv_sub3
string
Advertiser sub parameter 3
adv_sub4
string
Advertiser sub parameter 4
adv_sub5
string
Advertiser sub parameter 5
Example code
This method is utilized for removing all first-party cookies added by this package.
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