• I am using Google Analytics 2.9.2 on my WordPress blog at https://www.onelargeprawn.co.za and I believe there is an issue with onclick tracking for Google Anaytics when it comes to domain with two dots, for example .co.za.

    I looked at the page source, and I noticed that all .com (or .net. or .org) links have the “onclick=”javascript:pageTracker._trackPageview()” parameter, BUT for any link that ends in .co.za the onclick parameter is not being added.

    If you view the page source for this post (https://www.onelargeprawn.co.za/2009/05/29/lookie-look-win-ufc-2009-with-the-ps3-blog/) you’ll see that the link to Metacritic.com has the onclick parameter, but the link to ps3blog.co.za does not. I’ve checked other posts that contains links to co.za sites and none of them have the parameter as well.

    Is this a bug?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter onelargeprawn

    (@onelargeprawn)

    Bump. Any assistance here?

    Hey man, I’m using Google Analyticator on my site at https://www.triharder.co.za and haven’t had any problems. Try using that one instead?

    Thread Starter onelargeprawn

    (@onelargeprawn)

    Cheers triharder, I’ll investigate Googly Analyticator.

    Try replacing the body of the ga_get_domain function with this one:

    $hostPattern = "/^(http:\/\/)?([^\/]+)/i";
                            $domainPatternUS = "/[^\.\/]+\.[^\.\/]+$/";
                            $domainPatternUK = "/[^\.\/]+\.[^\.\/]+\.[^\.\/]+$/";
    
                            preg_match($hostPattern, $uri, $matches);
                            $host = $matches[2];
                            if (preg_match("/.*\..*\..*\..*$/",$host)) {
                                    preg_match($domainPatternUK, $host, $matches);
                            } else {
                                    preg_match($domainPatternUS, $host, $matches);
                            }
    
                            return array("domain"=>$matches[0],"host"=>$host);

    Added in 3.2.1 ?? Thanks for the patch!

    Hi, I’m on a .co.za domain, PHP 5, latest version of the plugin and I am experiencing a strange bug:

    I first noticed that this site has no stats since late August. Then I went in to the settings, and noticed the site id was no longer there. So I put it back in, but the plugin refused to accept my input. All text input fields have a question mark character in them (I’m using Firefox 3.5.3) which I think indicate some kind of text-encoding corruption.

    Every time I try to update the settings for the plugin I get the message: “Google Analytics settings reset to default.”

    I have tried disabling the plugin, deleting all the plugin files from my server and reinstalling, but to no avail. Any assistance gratefully received.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Google Analytics for WordPress Cannot Handle .co.za Domains?’ is closed to new replies.