Activation setup
To configure Targeting lists activation, please follow the next steps:
Contextual snippet installation (for website activation)
Targeting list / URL API implementation (for mobile app activation)
Activation plaftorm specific setup (for website & mobile app activation)
Contextual snippet installation
Setup
For website activation, you need to deploy a new mediarithmics snippet dedicated to Contextual targeting feature on every page where you want contexutal targeting activation to be performed. The mediarithmics Contextual targeting snippet is made of two parts:
The configuration that you should fill according to your context (site token & snippet name)
A technical part which contains the JavaScript code which asynchronously load the Contextual targeting tag on the page. This part should not be edited.
Here is an example of the Contextual targeting snippet you should implement:
<script type="text/javascript">
/* YOU CAN EDIT THIS PART */
const siteToken = "<SITE_TOKEN>" // token to change
const snippetName = "ctMics" // snippet name that can be changed
/* YOU SHOULD NOT EDIT THIS PART */
!function(e,t,s,i){"use strict";var a=e.ctscimhtiraidem||{};var r="call".split(" ");a._queue=a._queue||{},a._names=a._names||[],a._names.push(s),a._queue[s]=a._queue[s]||[],a._startTime=(new Date).getTime(),a._snippetVersion="ct-1.0";for(var n=0;n<r.length;n++)!function(e){var t=a[s]||{};(a[s]=t)[e]||(t[e]=function(){a._queue[s].push({method:e,args:Array.prototype.slice.apply(arguments)})})}(r[n]);e.ctscimhtiraidem=a,e[s]=a[s];e=t.createElement("script");e.setAttribute("type","text/javascript"),e.setAttribute("src",`https://events.mics-notrack.com/v1/sites/${i}/contextual_targeting.js`),e.setAttribute("async","true"),t.getElementsByTagName("script")[0].parentNode.appendChild(e)}(window,document,snippetName,siteToken);
</script>
You can find the site token, for each channel created, in Settings > Datamart > Channel.
As mentioned earlier, the Contextual targeting tag loaded through the snippet can also capture new URLs and associated hits.
Additional step for SPA
In case of a Single-page application, you will need to execute the following function whenever the URL change and, more exactly, on every page where you want contexutal targeting to be performed:
This call wil result in extracting the current URL to lookup associated Targeting lists and synchronize their IDs with configured activation platforms. Please make sure to call this function as soon as possible to ensure that the Targeting lists IDs are calculated before the auction is executed.
How it works
Contextual targeting tag will automatically:
Identifies the URL browsed by an anonymous user
Determines which targeting lists are associated to the URL
Proceeds to key/value targeting with the configured activation platforms
Targeting list / URL API implementation
For mobile app content to be eligible for activation, it must be linked to a URL that can be analyzed.
This means that Contextual Targeting can be used on applications that mirror a website. Semantic analysis and the creation of targeting lists are performed on the website, and the results of the analysis can then be made available to an application that calls our API with a known URL.
To enable mobile app activation, follow the steps below:
Integrate our dedicated API to fetch the targeting lists associated with a given URL within your mobile app.
Review the Signature Authentication documentation to learn more about how to autenticate when making API calls
In the API response, you will receive an array of targeting_list IDs (
idproperty intargeting_listsobject). These IDs must be passed to the activation platform in the next step.
Send the retrieved targeting_list IDs to the activation platform you are working with. Refer to the activation platform’s documentation for instructions on how to transmit these IDs.
Activation plaftorm specific setup
To enable activation on external platforms, follow the setup guide corresponding to each platform:
Last updated
Was this helpful?