Reporting Clicks and Impressions (deprecated)
Reporting clicks and impressions can take up to one hour on our staging environment. This is not reflective of production speed and should not be regarded as such.
Project Agora Commerce Javascript Library - Web integrations
The JavaScript Library (formerly the JavaScript SDK) makes it possible to send reports of clicks and impressions to Project Agora Commerce. The Javascript Library adds more tracking information and is advised for web based integrations.
The setup is straightforward. The API currently exposes two methods.
<script type="text/javascript" src="https://assets.citrusad.net/citrusjs/1.2.0/citrus.js"></script>
<script type="text/javascript">
var citrusAd = CitrusAd.init(
'$BASE_URL/v1',
{
disableTracking: false, // Optional: defaults to false.
trackingOptions: {
sessionId: 'YOUR_OWN_TRACKING_TOKEN' // Optional, this token can be used to tie impressions/clicks with a session token that you maintain
}
}
);
citrusAd.reportClick('adId').then(function (result) {
console.log(result);
}).catch(function (error) {
console.log(error);
})
citrusAd.reportImpression('adId').then(function (result) {
console.log(result);
}).catch(function (error) {
console.log(error);
})
</script>
Here is how to include a file using a script tag:
<script type="text/javascript" src="https://assets.citrusad.net/citrusjs/1.2.0/citrus.js"></script>
Last updated