0
votes

I have a JS code that extracts the Google Analytics information (___umtz). I just want to obtain the search term - however, on Firefox, it displays as "(not provided)" all the time. On Chrome, I am able to obtain the keywords used, but on FF, the cookie lists as '(not provided)'

As an example: utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided)

utmctr is alwayts (not provided) no matter what keywords I use for my website.

Here's an example code:

function parseCookie(name)

{ if (document.cookie.indexOf("__utmz=") != -1) { var c2 = readCookie(name); // This gets the cookie var ca2 = c2.split('|'); // This splits the cookie into parts

    temp = ca2[0].split('.');       // This grabs the first variable together with the numerical info
    temp2 = temp[temp.length - 1];  // This takes only the variable we are interested in
    ca2[0] = temp2;                 // We then replace the item in the array with just the variable data                                    

    var src = ' ';                  // Will contain the source, if there is one
    var campaign = ' ';             // Will contain the campaign, if there is one
    var medium = ' ';               // Will contain the medium, if present
    var term = ' ';                 // Will contain keyword info, if present
    var cancel = false;             // Used to check for AdWords ID

    for (i = 0; i < ca2.length; i++)
    {   
        temp3 = ca2[i];             //First, take each variable (ex. utmcsr=sourcename)
        temp4 = temp3.split('=');   //Splits into an array, with temp4[0] = 'utmcsr, and temp4[1] = 'sourcename' using our above example

        if (temp4[0] == 'utmgclid') //Identifies the varaible and replaces appropriate items for Google Adwords Campaigns
        {
            src = 'google';
            medium = 'cpc';
            campaign = 'google';
            cancel = true;          
        }

        if (temp4[0] == 'utmccn' && !cancel)
        {
            campaign = temp4[1];
        }

        if (temp4[0] == 'utmcsr' && !cancel)
        {
            src = temp4[1];
        }

        if (temp4[0] == 'utmcmd' && !cancel)
        {
            medium = temp4[1];
        }

        if (temp4[0] == 'utmctr')
        {
            term = temp4[1];
        }
    }

    alert(term);
}

}

1

1 Answers

0
votes

I was just around and found your question. I was working on the same topic mate, and leave a mark here for you. I think since the 2 month you asked this you may found your answer, but I leave a solution for future searchers here.

http://www.adviso.ca/blog/2012/03/21/explication-du-notprovided-dans-les-rapports-google-analytics-resultats-naturels/ The source of the solution is the above topic. It's not english but you can translate it with Chrome and it will be preatty understandable.

Google started to use an SSL encription with users who has an active Google Profile sign in. So the _utmctr will be a not provided value because of this. As G Profile spreads the keyword attribute will be removed from more and more searchers actions.

So most likely this is a not possible any more.