Integrating with network tag containers
We require two things for a fully automated and smooth integration:
A shared concept of an advertiser ID​
Each network has their own concept of advertiser (or brand, customer, affiliate, etc) ID. We need to know and understand your concepts to know how to map them to our internal business logic.
Automated webhook when advertiser activates our script​
When advertiser activates (and deactivates) our script, we need a notification (ideally API call to our platform) containing the following:
- Advertiser ID
- Name
- Website URL
Any other data points are welcome too, as they can enrich our own data and allow for more automated activities.
Automated webhook with transaction data​
On our dashboards we display performance of Contester experience, individual influencer, or a whole publisher network. To allow for a real-time updates, we require real-time API notifications.
Webhook needs to contain the following data:
- Transaction ID
- Date and time
- Amount
- Currency
- Advertiser ID
- Publisher / partner ID
- Our specified click reference
Integration process​
In essence for each network we provide a URL of a script that needs to be included on an advertiser website. As described here it is safe to add our script to each page load of a website as long as advertiser has enabled our script through your self-service.
The script URL contains an advertiserID that is familiar to a particular network so no information about our platform is required on network side.
Example URL of a script is as follows:
https://api.contester.net/api/public/scripts/routing/{network}/{advertiserId}.js
Executing this script will load advertiser-specific content onto their website.
Example tag implementation​
/**
* Example plugin implementation that is safe to include on ALL website traffic.
* It loads Contester-specific scripts and exposes your customer page-views to us
* only on URLs that contain query parameters prefixed with contester_
*/
(() => {
try {
// replace advertiserId and network with your own parameters
let advertiserId = "1"
let network = "network"
let contesterParamsFound = false
// there are a few params that initiate our content, so look for any query params that start with contester_ prefix
for (const [key, value] of new URLSearchParams(window.location.search)) {
if (key.toLowerCase().startsWith("contester_")) {
contesterParamsFound = true
break
}
}
if (contesterParamsFound && document) {
const script = document.createElement('script')
script.src = `https://api.contester.net/api/public/scripts/routing/${network}/${advertiserId}.js`
if (document.head) {
document.head.append(script)
} else if (document.body) {
document.body.append(script)
} else {
// fail silently
}
}
} catch (e) {
console.log("failure to include Contester loader", e)
}
})()