Hi everyone!
I have a code:
function sensdStats() {
var _paq = _paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
// _paq.push(["setCustomDimension", "1", obj[0]]);
// _paq.push(["setCustomDimension", "2", obj[1]]);
// _paq.push(["setCustomDimension", "3", obj[2]]);
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
(function() {
var u = URL;
_paq.push(["setTrackerUrl", u + "piwik.php"]);
_paq.push(["setSiteId", "siteID"]);
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);
})();
}
While im using an anonymous function in console from every site - it works fine, but when I try to fire sendStats() from <script> tag in my HTML - the stats doesn
t reach my stats server.
I tried to locate redirections from iOS, Android, Mac, but got nothing.
Can you, please, tell me, what am I doing wrong?