Skip to main content
Cloudflare Rocket Loader WarningFor any on page scripts using the Content Ignite JS API, it is important that you exclude the script from Rocket Loader (if used), which defers JS and in the case of the examples below, can prevent them from running altogether. Our JS API is a simple and fast way to queue the passing of information to our Publisher Tag, and as a result of the code not running immediately, has nil impact on page performance. Read more

Passing data to ID/Signal providers

Definition
When passing us PI for use by id/signal providers, ensure you pass it on every page load that the PI is available. For email, the obvious one is on login and every page load while logged in, but a secondary important scenario is newsletter sign up! In this case, you are looking to pass the email address at every opportunity.
PrivacyIt is worth noting that any PI passed through using this method never reaches the Content Ignite servers. We do not store this data in any way, we simply act as the “pipes” to pass it to the ID vendors you’ve configured in Fusion, all handled client side.
Example

Setting targeting

Definition
This method allows you to pass custom page targeting directly to our tag, this could be data returned by your CMS for example.
It is against our terms of service, and Googles, to pass in Personal Information via this feature, things such as email addresses, age, gender etc are forbidden.
Example

Mergeing vs Overwriting vs deleting key-values

When you call .setTargeting() with a string value, it will merge that value with any existing values for that key. If you call it with an array value, it will overwrite any existing values for that key. To delete targeting values for a given key, call .setTargeting() with the value NULL.

Config/Slot level targeting

Definition
The optional third parameter of .setTargeting() allows you to pass targeting for a specific slot, identified by either the config ID, unit type or parent container ID. If not passed, the targeting will be applied at the page level.
Example

Targeting Macros

When passing targeting values, you can also use macros to pass dynamic values. The macros available are:
  • {CONFIG_ID} The config ID as it is in Fusion; e.g. 1234
  • {INSTANCE_COUNT} The instance count for repeating units; e.g. 1, 2, 3 etc
  • {UNIT_TYPE} Unit type from Fusion; e.g. in-image, adhesion, iab etc
Simply include the macro in the value string and it will be replaced with the relevant value for each ad unit when the tag processes the targeting.
Example

IAB Taxonomy (reserved keys)

We support two different IAB taxonomy types, which you can pass in via .setTargeting() by use of their reserved keys, these are: For example, to pass the content taxonomy of “Automotive”, you’d call:
Example
Note that if you enable contextual inside of Fusion for a given publisher, then the IAB_CONTENT_2_2 taxonomy is already passed for you!

SPA reloads

Definition
Strictly for use in SPA’s (Single Page Applications). This will cause a new page impression to register and all existing ads to be destroyed and re-built.
Example

Tag Events

For custom development, there are several JavaScript events that are triggered throughout an ads life cycle. You can hook into these as needed to perform additional follow-up actions. These are standard JavaScript events, available on the window the tag was deployed into. For example, for a direct tag-on-page deployment, you can listen to an event with the following:
Example
Depending on the event, a detail object is returned with the following optional fields:
  • detail.config_id - STRING - The id of the ad unit the event was triggered from
  • detail.msg - STRING - Further details of the event
  • detail.targeting - OBJECT - The key-value targeting applied to the slot for the ad request. Only present on the ci_al and ci_am events (see Reading slot targeting below).
The following events are available:

Reading slot targeting

The ci_al (Ad Load) and ci_am (Ad Miss) events include a detail.targeting object containing all of the key-value targeting that was applied to that slot for the ad request — in other words, everything that was sent to the ad server. This includes any values you set via .setTargeting(), the tag’s own key-values, and the header-bidding keys applied during the auction (such as hb_pb, hb_size, amznbid and amznsz). Each value is returned as an array of strings. This lets you react to the outcome of the auction — for example the winning size and price — from your own page code, without needing to read from Prebid or Amazon directly.
Example