PocketAffiliates.com

The community for mobile affiliates and affiliate managers
It is currently Thu Sep 09, 2010 4:51 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Google Mobile Analytics - Pixel Rendering Issue
PostPosted: Mon Nov 16, 2009 9:46 pm 
Offline
Site Admin
User avatar

Joined: Tue Jun 17, 2008 4:38 pm
Posts: 66
Hi All,

We've been experiencing some issues with the new Mobile Analytics Beta from Google. After a bit of experimentation we tracked it down to the passing of the absolute URL in the 'utmr' parameter to the ga.php file. After modifying the code as shown below (between Custom Start - Custom End) we get a consistently rendered pixel and should therefore start to gain accurate statistics once again... we'll check to see that actual pages are being registered correctly too over the coming days and report back.

We've posted on one of the Google forums that it was playing havoc with our bounce rates as the first page was always rendered due to the empty 'utmr' parameter. Any subsequent calls would then fail to register as the 'utmr' param would contain the absolute URL. If we here back from Big G then we'll let you know...

// Copyright 2009 Google Inc. All Rights Reserved.
$GA_ACCOUNT = "MO-XXXXXXX-X";
$GA_PIXEL = "ga.php";

function googleAnalyticsGetImageUrl() {
global $GA_ACCOUNT, $GA_PIXEL;
$url = "";
$url .= $GA_PIXEL . "?";
$url .= "utmac=" . $GA_ACCOUNT;
$url .= "&utmn=" . rand(0, 0x7fffffff);

$referer = $_SERVER["HTTP_REFERER"];

// Custom Start
// Get rid of the absolute URL as this seems to cause a 404 when fetching the .gif
$ref_arr = explode("/", $referer);
$ref_count = count($ref_arr);
$referer = $ref_arr[$ref_count-1];
// Custom End

$query = $_SERVER["QUERY_STRING"];
$path = $_SERVER["REQUEST_URI"];


Top
 Profile  
 
 Post subject: Re: Google Mobile Analytics - Pixel Rendering Issue
PostPosted: Thu Nov 19, 2009 6:36 am 
Offline
Site Admin
User avatar

Joined: Tue Jun 17, 2008 4:38 pm
Posts: 66
Panic over... we tested this custom code over a couple of days and quickly realised we were losing all of the referral information so don't use it...

The problem was actually down to some Rewrite Rules that we had in the .htaccess file... we put those in to stop URL injections a while back but now we're running mod_security it does the same job...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group