Passing Custom Dimensions & Custom Variables
The properSpecialOps
variable can be used to pass properties - and values to Sovrn for custom targeting, reporting and wrapper functionality. Key-value pairs can also be passed as custom attributes within the ad unit <div> for slot-level targeting.
Page-Level
Add the code below to the <head> of the page, before the Sovrn header bidder script:
properSpecialOps = window.properSpecialOps || {};
Follow this code with the specific variables and properties defined below.
Variables and Properties
properSpecialOps.page_meta
These properties can be used to pass custom key-value pairs into Sovrn reporting or Google Ad Manager for page-level direct-sold campaign targeting and custom reporting.
Predefined
Property | Description | Pass to GAM or Sovrn Analytics? | Data Type | Example |
---|---|---|---|---|
"tags" | identify post by keywords | Both | array | ["baseball", "padres"] |
"category" | identify post by category | Both | string | "sports" |
"editor" | post editor | Sovrn only | string | "jane" |
"writer" | post writer | Sovrn only | string | "john-s" |
"buyer" | media buyer | Sovrn only | string | "alex" |
"page_type" | page type | Sovrn only | string | "article" |
"split" | identify test split versions | Sovrn only | string | "15432" |
"dfp_kv" | GAM key values | GAM only | object | { 'sport': 'baseball' , 'team': 'padres' } |
"custom" | pass custom dimensions | Sovrn only | object | see below |
Note:
Max 500 characters for array
Max 50 characters for string
Max 20 characters for keys / 40 characters for value
Custom dimensions
Publishers can also pass up to 10 of their own custom dimensions to Sovrn's reporting platform.
Property | Data Type | Example |
---|---|---|
dimension_1 | string | "word_count-523" |
dimension_2 | string | "layout-12" |
dimension_3 | string | "april" |
dimension_4 | string | โ26โ |
dimension_5 | string | โ2021โ |
dimension_6 | string | โsponsored-yesโ |
dimension_7 | string | "5a43cx9" |
dimension_8 | string | "43987" |
dimension_9 | string | "theme-blue" |
dimension_10 | string | "commerce-no" |
Note: To pass custom dimensions as key-values into GAM as well, add:
"set_as_kv_to_gam" : true
Max 100 characters
Dimension names can be included in the value to identity it or not, (e.g. "month-april" or "april")
properSpecialOps.post_id
This property will allow you to set a unique page-level identifier for custom targeting only. This identifier will not be available in reporting.
Example:
properSpecialOps.post_id = 753169;
properSpecialOps.isolated
This property gives publishers the ability to disable ad requests from being sent to Google Ad Manager at the page level. This can be utilized when a URL has been flagged by Google, or when Google has disabled ad serving on a URL for content policy reasons. โ1โ is true (do not send requests to Google), and โ0โ is false.
Example:
properSpecialOps.isolated = 1;
Example Page-Level Code
properSpecialOps = window.properSpecialOps || {};
properSpecialOps.page_meta = {
"tags": ['baseball', 'padres'],
"category": "sports",
"editor": "jane",
"writer": "john-s",
"buyer": "alex",
"page_type": "article",
"split": "15432",
"dfp_kv": {
'sport': 'baseball',
'team': 'padres'
},
"custom": {
"dimension_1": "word_count-523",
"dimension_2": "layout-12",
"dimension_3": "april",
"dimension_4": "26",
"dimension_5": "2021",
"dimension_6": "sponsored-yes",
"dimension_7": "5a43cx9",
"dimension_8": "43987",
"dimension_9": "theme-blue",
"dimension_10": "commerce-no",
"set_as_kv_to_gam": true
}
};
properSpecialOps.post_id = 753169;
properSpecialOps.isolated = 1;
Slot-Level
Pass a key-value pair in an ad unit <div> using the following attributes: :
data-gamTaretingKey
data-gamTargetingValue
Example Slot-Level Code
<div class="sovrn-leaderboard" data-gamTargetingKey="tags" data-gamTargetingValue="sponsor"></div>
Need more help?
If you still have questions, please reach out to admanagement@sovrn.com