Javascript Analytics Code Manipulation (G. Analytics)

Viewed 1172

for my job I am doing an research projekt on the validity of Google Analytics (mostly in regards to the verified reports on flippa) --> see if it is possible to completly fake G. Analytics (a simple Yes will not cut it)!

I modified the G. Analytics code as following:

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-19629541-5']);
_gaq.push(['_setAllowHash', false]);
_gaq.push(['b._setAccount', 'UA-19629541-5']);
_gaq.push(['b._setAllowHash', true]);

for (var i=0;i<=10;i++) {
  _gaq.push(['_trackPageview']);
  _gaq.push(['b._trackPageview']);
}
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async =   true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') +         '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

It will now spawn multiple visits and visitors when you run it. You can see that the second number on __utma changes for every pageview, that number is the visitorId, when it changes it means you get a new visitor

The problem is that the stats I get now look like this:

  • Visits: 1,785
  • Unique Visitors: 1,781
  • Pageviews: 2,188
  • Pages / Visit: 1.23
  • Avg. Visit Duration: 00:00:03
  • Bounce Rate: 96.13% %
  • New Visits: 99.78%

Please not the extreme decrease in avg. visit duration!

before they were similar to this:

  • Visits: 135
  • Unique Visitors: 118
  • Pageviews: 383
  • Pages / Visit: 2.84
  • Avg. Visit Duration: 00:04:22
  • Bounce Rate: 57.78%
  • % New Visits: 68.89%

Now my question: How would I need to modify the G. Analytics Code (if at all posible) to make it look similar to this:

  • Visits: 135 * 10 = 1350
  • Unique Visitors: 118 * 10 = 1180
  • Pageviews: 383 * 10 = 3830
  • Pages / Visit: 2.84
  • Avg. Visit Duration: 00:04:22
  • Bounce Rate: 57.78%
  • % New Visits: 68.89%

so basically increase the amount of Visits, Unique Visitors, Pageviews 10 fold yet leave the other stats the same.

Examples on http://jsfiddle.net are greatly welcomed

PS: sorry for my bad English (not my mother tongue)

3 Answers
Related