Charles, It’s Not Just For Tag Validation – Part 2

In Part 1, we reviewed how Charles can be used to swap local files with files on your production site to test changes made to your tracking code.   Now, in Part 2, we will take the Map Local feature in Charles to a whole new level by mapping files that don’t yet exist on your site.   Using Map Local To Inject Tracking Scripts   Here is the scenario.  You need to test some data collection code and not only do you not have access to a development environment but none of your scripts are even on the site you need to track.  As a consultant, this comes up more than you may think.  Having the ability to code against a client’s site, without having deployed any tracking code, keeps you one step ahead of the game.  I could accept the inevitable and start saving local copies of the site…..or…..I can use Charles to inject my files into the site.  Yeah, let’s do that.   NOTE: This scenario is specific to injecting Omniture’s page tracking code but this process could be modified for use with other Vendor’s page tags.   Using the DigitalPulse Debugger, we can see that this site does not contain any Omniture tracking code.     1.  The first step is the identify a JS file we can hijack.  I’m using a Firefox plugin called JSView to quickly see all the scripts that are loaded on my site.     2.  I’ve decided I’m going to use the file ‘builder.js’.  So i’ll save a local copy of that file to my desktop.   3.  Add the following...

Charles, It's Not Just For Tag Validation – Part 1

When I first started implementing web analytics solutions for clients, my tool of choice for peeking inside the image requests being sent to the vendor was Charles.  I’ve since moved on to using httpFox as my primary page tag validation tool but Charles has other features that I just can’t live without.   Map Local   Here is the scenario.  You need to test some data collection code but you don’t have access to a development environment, you could do a “save as web page complete” on all the pages you need to test, but who wants to go through that hassle? Introducing…..Map Local.   Using the new DigitalPulse Debugger, you can see I’m only capturing page name but I’d really like to set a success event when a visitor reaches the ‘Work with Jason’ page.     1.  Save a local copy of the file you are going to modify, I’ll be making a few changes to the ‘s_code.js’ file.   2. Open the file in your favorite text editor and make your code changes.   [javascript] //set ‘work with jason’ success event if (window.location.href.toLowerCase().indexOf(“/work-with-jason/”) > -1){ if (typeof s.events==”undefined”){ s.events=”event1″; }else{ s.events+=”,event1″; } } [/javascript]   3. Open Charles and select Tools–>Map Local   4. Map your local file to the file located on the site.     Now when I browse http://emptymind.org Charles is swapping the file located on the server at http://empttymind.org/s_code.js with the local s_code.js file located on my desktop.   When I view the ‘Work With Jason’ page again, this time using the local copy of my data collection code, the debugger is showing the...

Charles, It’s Not Just For Tag Validation – Part 1

When I first started implementing web analytics solutions for clients, my tool of choice for peeking inside the image requests being sent to the vendor was Charles.  I’ve since moved on to using httpFox as my primary page tag validation tool but Charles has other features that I just can’t live without.   Map Local   Here is the scenario.  You need to test some data collection code but you don’t have access to a development environment, you could do a “save as web page complete” on all the pages you need to test, but who wants to go through that hassle? Introducing…..Map Local.   Using the new DigitalPulse Debugger, you can see I’m only capturing page name but I’d really like to set a success event when a visitor reaches the ‘Work with Jason’ page.     1.  Save a local copy of the file you are going to modify, I’ll be making a few changes to the ‘s_code.js’ file.   2. Open the file in your favorite text editor and make your code changes.   [javascript] //set ‘work with jason’ success event if (window.location.href.toLowerCase().indexOf(“/work-with-jason/”) > -1){ if (typeof s.events==”undefined”){ s.events=”event1″; }else{ s.events+=”,event1″; } } [/javascript]   3. Open Charles and select Tools–>Map Local   4. Map your local file to the file located on the site.     Now when I browse http://emptymind.org Charles is swapping the file located on the server at http://empttymind.org/s_code.js with the local s_code.js file located on my desktop.   When I view the ‘Work With Jason’ page again, this time using the local copy of my data collection code, the debugger is showing the...