Follow

Switch Invocation Code / Tag guide

How should I implement Switch tags?

Tags should be placed directly on the webpage, within the body of the pages code.

Tags must not be modified in anyway apart from what has been outlined below.

Unfortunately we are unable to troubleshoot any issues when tags have been modified.

Where in the tag does the Click Macro need to be entered?

Using the rct parameter, see below example:

<script> (__scads = window.__scads || []).push({"z":7910,"rct":"INSERT_CLICK_TRACKING_HERE","targetId":"switch_placeholder_7b80cc895824a19a7df3212595bcfc60","domain":"delivery.x.switchadhub.com","width":"0","height":"0"}); </script>

Does the tag work on secure pages?

Yes, the tags will work on secure pages as they mimic the protocol of the page. 

How is site source entered into the new tag?

Please see the example below:

<script> (__scads = window.__scads || []).push({"z":7910, "source": "category:cats","rct":"INSERT_CLICK_TRACKING_HERE","targetId":"switch_placeholder_76f9e02dd41ec8c5a592f5391552cf7e","domain":"delivery.x.switchadhub.com","width":"0","height":"0"}); </script>

How is a variable entered into the tags?

 Please see the example below:

<script> (__scads = window.__scads || []).push({"z":7910, "variables":{cats: "persian"} ,"rct":"INSERT_CLICK_TRACKING_HERE","targetId":"switch_placeholder_76f9e02dd41ec8c5a592f5391552cf7e","domain":"delivery.x.switchadhub.com","width":"0","height":"0"}); </script>

What is the domain visibility with friendly Iframes?

Friendly Iframes do not have the same visibility restrictions as standard Iframes, however if we are trafficked within multiple Iframes ourselves then it's likely Switch won't be able to read the true domain. 

Does the tag need to have a cache buster inserted?

No. It generates it's own cachebuster for each request to the adserver, and auto-updates itself from request-to-request, so there's no need to add one in.

How do you deliver Rich Media Ads, using the new style tags?

Most creatives will be coded to support Friendly Iframes, however in instances where they haven't been, you'll notice this as the creative will not be fully interactive. This will likely be due to the code base restricting interactivity to the first frame as Switch is served in two. In some instances, the code can work if the appropriate functions which reference "window.parent" are altered.