Showing posts with label Analytics. Show all posts
Showing posts with label Analytics. Show all posts

Monday, February 17, 2014

Experiment code missing the cookie domain name declared in tracking code

If you still dont know why you get the error:

Your google analytics code had "subdomain" enabled mode. for example www.igloro.info is main domain, and kambariokai.igloro.info is subdomain and it has enabled subdomain mode.
When I have tried to create experiment I got the error.

Solution:


  1. Open your google analytics code and copy _setDomainName.
  2. Open code which you have added into your . And add code before experiment code replacing domain name with your one:

Thursday, June 20, 2013

Tracking redirects with google analytics

I have tried to use php headers, but no success. Google analytics cant track page with php header location.

meta tag is not good way for me... so i found fastest redirector with javascript.

Here is code:

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-******-*']);
_gaq.push(['_trackPageview']);
_gaq.push(function() {
      setTimeout(function() {
        window.location = "http://pilotaz.blogspot.com";
    }, 250);
});
(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 is a simple google analytics script with window.location method in function.