About Special Ops

Special Ops is a Javascript variable with properties that can dictate how the Proper script runs. In layman terms, it provides our code with information that we can use to perform actions like: targeting direct deals to that page only, speed up the ad load time, disable Google, etc.

 

Types of Special Ops

Below you will find an outline of the possible keys that can be used.

 

Special Ops Property #1 Page Type

What? Defines the "page type" or ad templates used, such as homepage, article page, or index page. That page type corresponds with a setting on our side which tells our code which ad slots are part of that page type, similar to possible_ads.

Why? Speeds up the time to ad request for each ad slot and reduces the number of total ad requests.

How? Passes the page_type to the Proper script, which corresponds with an adjustable setting on our end that tells our code which ad slots are part of that page type, similar to possible_ads.

Page Type Example

special_ops.page_type = "home";
or
special_ops.page_type = "article";

 

Special Ops Property #2 Possible Ads

What? Lists the ad slots that will be used on the page.

Why? Speeds up the time to ad request for each ad slot.

How? Tells the Proper script which ad units to expect so it can pre-fetch all ad requests upon initial page load, rather than when each ad slot is written to the page.

Possible Ads Example

special_ops.possible_ads = ['example_side_1','example_side_2','example_main_1','etc'];

 

Special Ops Property #3 Tags

What? Defines the category of the content on the page.

Why? More advanced reporting, and more specific direct deal targeting. Ads can be targeted to include or exclude specific "tags."

How? Passed to our ad server via a key-value pair. Also appears in the Advanced Dashboard under the Tags dimension.

Tags Example

special_ops.tags = ['sports', 'baseball', 'Padres', 'etc'];

 

Special Ops Property #4 Post ID

What? A unique identifier of each page on your site.

Why? Ad targeting down to the specific page level.

How? Passed to our ad server via a key-value pair.

Post ID Example

special_ops.post_id = 753169;

 

Special Ops Property #5 Isolated

What? Turns on/off Google demand. 0 = Google turned on, 1 = Google turned off.

Why? Google demand should be disabled on pages that violate Google's ad policies.

Isolated Example

special_ops.isolated = [0];
or
special_ops.isolated = [1];

 

Implementation

Special Ops must always go above our header script. This ensures that it is loaded before anything else, so it can effectively impact the elements on the page that it needs to.

Javascript -  special_ops is the variable, followed by the object properties and values of each.

Example

<script>

     var special_ops = special_ops || {};

     special_ops.page_type = "article";

     special_ops.tags = ['News', 'Politics', 'Election'];

     special_ops.isolated = 1;

     special_ops.possible_ads = ['example_main_1','example_main_2','example_side_1'];

     special_ops.post_id = 8675309;

</script>

 

For multiple tags be sure to include single quotes around each one ie: 'tag1', 'tag2' etc.

 

Other Articles You Might Like: