I am using Google Analytics to track visitors of my website. I also want to track IP address of the visitor but Google doesn't allow this. Now I am thinking that I must save IP address of the visitor on my database before sending visit information to Google Analytics. So when I retrieve information I can glue the IP address with visit information.
But when I query to Google Analytics using following code:
$optParams = array(
'dimensions' => 'ga:browser,ga:fullReferrer,ga:source,ga:keyword,ga:campaign,ga:customVarValue1,ga:customVarValue2'
);
return $analytics->data_ga->get(
'ga:' . $profileId, '2013-07-16', '2013-07-20', 'ga:visits',$optParams);
It is returning data like this:
[rows] => Array
(
[0] => Array
(
[0] => Chrome
[1] => (direct)
[2] => (direct)
[3] => (not set)
[4] => (not set)
[5] => 1366
[6] => 667
[7] => 2
)
[1] => Array
(
[0] => Firefox
[1] => (direct)
[2] => (direct)
[3] => (not set)
[4] => (not set)
[5] => 1366
[6] => 596
[7] => 1
)
[2] => Array
(
[0] => Internet Explorer
[1] => (direct)
[2] => (direct)
[3] => (not set)
[4] => (not set)
[5] => 1366
[6] => 673
[7] => 1
)
)
It is returning data with respect to browser vise. I want data returned with respect to visit vise means every index of row object should be with respect to each visit so that I can make my ip information saved on my local and visit information returned by Google together in report. Is there any way to do it?