How to Automate Web Analytics testing?

mb963 picture mb963 · Jul 30, 2013 · Viewed 7.6k times · Source

Omniture/SiteCatalyst's code is integrated onto the webpage to collect the analytics in our firm.

Current process: SiteCatalyst id deployed by pasting HTML code onto each page of the website. This HTML code contains variables and other identifiers that facilitate the data collection process. These variables may be dynamically populated with server or application variables. The code snippet also calls the JavaScript library file, which contains SiteCatalyst-specific JavaScript functions used during metrics collection.

We use Add-on's like Charlie, HTTP Post, DigitalPulse Debugger to Test if the code inserted has accurate values corresponding to it. This process is time consuming and tedious.

How to Automate this process? Any help would be appreciated!

Example 1:

 <a href="javascript:void(s.t());">Click here to send a page view</a>
 s.pageName="New Page"
 s.prop1="some value"
 void(s.t());

Example 2:

 s=s_gi('myreportsuiteid');
 s.linkTrackVars="prop1,eVar1,events"; s.linkTrackEvents="event1";
 s.prop1="some value"; s.eVar1="another value"; s.events="event1";
 s.tl(this,'o','My Link Name');

Answer

BrettAHale picture BrettAHale · Aug 14, 2013

There are a few different ways to automate testing. I've been looking into it lately myself. So far I'm looking into Selenium, Zombiejs and Phantomjs. You can search for "headless testing" which basically let's run code as a browser and test conditions on the page you visit.

Here's a good place to start https://github.com/ariya/phantomjs/wiki/Headless-Testing

Using these platforms, you could easily set pages to automatically validate if the SiteCatalyst code is firing, page names are correct, click events happen etc.

Selenium is an enterprise product whereas the JS frameworks would be more of a development effort.