_paq turning into object


#1

So this is hard to explain, but my _paq array is turning into the following object under the following circumstance.

I have a page that has tabs. The page will load and run the tracking js, then the tab will do the same. (Don’t worry about duplicate urls or whatnot)
On the second time through running the default tracking js, console.log(_paq) returns an object.

Code:


<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  console.log(_paq);
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u="//piwik.example.com/piwik/";
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['setSiteId', 1]);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
  })();
</script>
<noscript><p><img src="//piwik.example.com/piwik/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->

Output (I expanded the object a bit to give an idea, if you need more just post):


[]
 
Object {push: function}
push: function R(){var W,Y,X;for(W=0;W<arguments.length;W+=1){X=arguments[W];Y=X.shift();if(n(Y)){L[Y].apply(L,X)}else{Y.apply(L,X)}}}
arguments: null
caller: null
length: 0
name: "R"
prototype: R
constructor: function R(){var W,Y,X;for(W=0;W<arguments.length;W+=1){X=arguments[W];Y=X.shift();if(n(Y)){L[Y].apply(L,X)}else{Y.apply(L,X)}}}
arguments: null
caller: null
length: 0
name: "R"
prototype: R
constructor: function R(){var W,Y,X;for(W=0;W<arguments.length;W+=1){X=arguments[W];Y=X.shift();if(n(Y)){L[Y].apply(L,X)}else{Y.apply(L,X)}}}
__proto__: Object
__proto__: function Empty() {}
<function scope>
__proto__: Object
__proto__: function Empty() {}
<function scope>
__proto__: Object
__defineGetter__: function __defineGetter__() { [native code] }
__defineSetter__: function __defineSetter__() { [native code] }
__lookupGetter__: function __lookupGetter__() { [native code] }
__lookupSetter__: function __lookupSetter__() { [native code] }
constructor: function Object() { [native code] }
hasOwnProperty: function hasOwnProperty() { [native code] }
isPrototypeOf: function isPrototypeOf() { [native code] }
propertyIsEnumerable: function propertyIsEnumerable() { [native code] }
toLocaleString: function toLocaleString() { [native code] }
toString: function toString() { [native code] }
valueOf: function valueOf() { [native code] }
get __proto__: function __proto__() { [native code] }
set __proto__: function __proto__() { [native code] }


#2

So I’ve dug a bit further and found out that the object that’s being returned is a TrackerProxy() function. and the only value is push: apply. This is very strange and I’m not sure what to do with this. Any and all help would be much appreciated.