JS Tracker SDK Integration Guide
Overview
This documentation will detail the specifications of the javascript based SDK to track the events on your website.
It works by loading a small javascript snippet into your webpage and calling designated functions whenever you need to track an event.
Prerequisites
We assume that the initial web page where this is used is visited by clicking on an Ad Banner on Dailyhunt App.
Dailyhunt will append a parameter called dhPayload
to the landing page. This parameter is crucial for the tracker to work. So, if there is any whitelist of parameters at the landing page, make sure to whitelist this parameter.
Code Snippet
Make sure to include this script in the <head>
section of all the webpages you want to track events on.
note
This code snippet is self sufficient to track the page views by default.
Tracking Additional Events
If you need to track additional events, you can do that using dht()
function.
Syntax
Parameters
Parameter | DataType | Scope | Description | Example |
---|---|---|---|---|
eventName | string | required | Name that you need this event to be identified with. | PageView AddToCart |
eventValue | object | optional | Data - in json format - to be associated with the event. | {userId: "1", gender: "M"} |
Examples
Please note
If you have difficulty in any of the above steps of this guide, feel free to contact ads-tech-team@verse.in. We will get back to you as soon as possible.