|  Register

Asynchronous Omniture SiteCatalyst with Google Tag Manager

by brett hale in Omniture

If you haven't heard or checked it out, I would highly recommend doing so. It's not the most robust Tag Management solution but it's pretty solid for someone who doesn't need Ensighten or BrightTag etc. It's got the built in functionality to server Google Analytics, AdSense and other Google products (no brainer) but I'm here to talk about Omniture SiteCatalyst tags. Off we go...

  • I'm sure there are many ways to do this. My goals were as follows:
  • Load the core s_code.js file and only have to update it to newer versions.
  • Have freedom to change my customizations without having to go through the development cycle and take QA out of the picture and be completely autonomous where I could be.
  • Reduce the overall size of the s_code.js file and be able to control the code fired on a page or page group basis. This isn't such an impact on a PC but keeping the sizes and bandwidth down for mobile devices is important to me. If I'm not mistaken, Google likes this too.

For my test run, I created to tags for my container and used an event macro. The event macro is already setup so I'll start with the tags.

Place this script code before the Google Tag Manager Page Code : 



Tag 1 : SiteCatalyst Core Code - Nothing fancy, let's bring in a script tag. Both of these next tags should be set to fire on any page you want SiteCatalyst to run.


<script type="text/javascript" src="/addons/default/themes/hoho/js/s_code.js" />


Tag 2 SiteCatalyst Page Code - Standard Page Code with a variable. This should be set to fire only when it sees the "oscLoaded" event. You'll see this code later in this article.


<!-- SiteCatalyst code version: H.25.1.
Copyright 1996-2012 Adobe, Inc. All Rights Reserved
More info available at http://www.omniture.com -->
<script language="JavaScript" type="text/javascript"<>!--
/* You may give each page an identifying name, server, and channel on
the next lines. */
s.eVar1="test if s object exists";

/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/
var s_code=s.t();if(s_code)document.write(s_code)//--></script><script language="JavaScript" type="text/javascript"><!--
//--></script><noscript><img src="http://your_domain.d2.sc.omtrdc.net/b/ss/suite/1/H.25.1--NS/0"
height="1" width="1" border="0" alt="" /></noscript><!--/DO NOT REMOVE/--><!-- End SiteCatalyst code version: H.25.1. -->


Now that we have that set up, let's make it work by editing the s_code file itself. This is what the first few lines of the file look like. We copy the s object we created and the core s_code work it's magic. I'm using JQuery to copy all the variables from the existing s object to the new s object the s_code creates. If you prefer not to use JQuery, see the code below it.


var tmp_s = window.s;
 var s_account="rsid";
 var s=s_gi(s_account);
 $.extend(s,tmp_s); //no JQuery, use this instead 
 //for (var attr in tmp_s) { s[attr] = tmp_s[attr]; }


Now this is added as the last line. This let's Tag 2 that we've loaded the core file and we can continue with SiteCatalyst processing and eventually the s.t() call. The second tag container we created should be set to fire when the event contains 'oscLoaded'.


window.dataLayer.push({'event': 'oscLoaded'});


Please test this thoroughly before putting into production. I haven't yet put it through all the paces. Do you know a way to do it better? See something funky? Feel free to leave a comment or dial up a twitter converstaion.





Thanks for the Info and its an exact answer which I was looking for.



brett hale


Hi Suresh, You can use the digital pulse debugger to verify the tag firing. You will then need to log in to the SC UI and verify it there as well. What addons would you need to verify?

Link to debugger: http://blogs.adobe.com/digitalmarketing/analytics/meet-the-new-digitalpulse-debugger/

You can also use OmniBug for Firefox.





Am suresh and I want to know how can we verify whether the SC (site catalyst Code) is functioning on the site or not. If any add-ons are present to verify, kindly inform me :)

Thanks in-advance,
Suresh Sarraju.


brett hale


The script blocks labeled "Tag 1" and "Tag 2" are GTM tags and loaded asynchronously through the tag manager. I stopped using this when Omniture made their tag manager free. And, as Judah pointed out, there are some hurdles that still need to be addressed.




how is this async, you are loading the s_code file. I want to load everything async


brett hale


Nice, thanks Hedi


Hedi Lassoued


Hi Brett,

I like the way you are doing it!
Here i did it the same way (theoric way ) and different way (technical way):

First project :

Second project : an easy way to Asynchron. the s_code (check the omn.js)




Judah Anthony


Does this actually work? According to the GTM docs they do not support any synchronous reporting and/or anything with [removed](): http://support.google.com/tagmanager/answer/2787990/



Nice work. I am not very keen on omniture code but I am wanting to crack this solutions. Omniture inside or paired with GTM and free of a dev cycle.

Any updates?



Hi Brett,
I'm currently setting up GTM with Omniture as well.
I'm planning on keeping the logic of which report suite to send the data to in the s_code (which would be based on the domain).
Then I'm creating macros for each prop and evar based on existing or new onsite variables.
After that, I'll create the rules for firing off the Omniture code (basically just on the live pages and not on the dev ones).
I then repeat for the other tracking systems by matching the macros to their corresponding JavaScript variables.
Hopefully it'll work!

Post a comment

  • Top ↑
  • ©2019 StraightFromHale.com. All Rights Reserved.