Go to Qubit

Opentag documentation

Scripts

There are two ways of adding a tag: our tag library, or custom scripts.

Tag library

Tags can get pretty complicated. Thats why we recommend using our tag library 99% of the time. The tag library is a growing list of over 800 code templates for over 200 different vendors.

How does it work?

Most of the time, vendors ask for the same code to be deployed on all of their clients’ sites. The only difference between clients is the parameters inputted to the tag (Google Profile ID, Doubleclick Cat Param etc). That’s why we have our tag library – so you don’t have to touch code, you just have to input these parameters.

Adding a tag from the library

Let’s add another tag to your container, but this time from the tag library.

Step 1: Find the tag in the library: Re-targeting > Google > Google Remarketing Conversion Async.

Click “toggle detail”, and you should see the following:

tagdetail

The highlighted parts of the code are where the parameters will be substituted.

Step 2: Input example parameters for the Google Conversion ID (e.g. 123456789) and Google Conversion Label (e.g. g4f3121uiniu321321) by clicking “add new custom variable” and inputting them as “hard coded values”.

Step 3: Name your tag, save it, and commit your container. If you re-open the debug tool on the page, you should now see both tags firing.

The tag library enables you to add tags to your site in far less time, as we’ve already done the heavy lifting for you!

Custom scripts

If the tag library doesn’t quite give you the flexibility you’re looking for, Opentag allows you to run any custom JavaScript tag using the “custom script” option.

You may recognised the snippet of code below, it’s a sample of Google’s Universal Analytics tag, used for web analytics. It’s also one of simplest tags (in its current form) that can be run on a page.

<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-XXXX-Y', 'auto');
ga('send', 'pageview');

</script>
<!-- End Google Analytics -->

Let’s use this tag as an example for adding to your container.

Adding the tag

Step 1: If you’re not already, login to your Opentag account.

Step 2: Click “add new script”, then select “custom script”. You should now see a rather intimiating looking black code box.

Step 3: Copy and paste the code above into the code box.

Step 4: Give your tag a name. This can be whatever you like, for example, “Google Universal Analytics testing”.

Step 5: Scroll down to the bottom of the page and click “save”.

Was this helpful?