Mobile app version of vmapp.org
Login or Join
Annie201

: GAPI output doesn't match Google Analytics website I have to get the main info about my Google Analytics Goals. I'm using GAPI lib, with this code: <?php require_once 'conf.inc'; require_once

@Annie201

Posted in: #Api #Google #GoogleAnalytics #Php

I have to get the main info about my Google Analytics Goals.

I'm using GAPI lib, with this code:

<?php
require_once 'conf.inc';
require_once 'gapi.class.php';

$ga = new gapi(ga_email,ga_password);

$dimensions = array('pagePath', 'hostname');
$metrics = array('goalCompletionsAll', 'goalConversionRateAll', 'goalValueAll');

$ga->requestReportData(ga_profile_id, $dimensions, $metrics, '-goalCompletionsAll', '', '2012-09-07', '2012-10-07', 1, 500);
$gaResults = $ga->getResults();

foreach($gaResults as $result)
{
var_dump($result);
}


cut this code is output:

object(gapiReportEntry)[7]
private 'metrics' =>
array (size=3)
'goalCompletionsAll' => int 12031
'goalConversionRateAll' => float 206.93154454764
'goalValueAll' => float 0
private 'dimensions' =>
array (size=2)
'pagePath' => string '/catalogs.php' (length=13)
'hostname' => string 'www.example.com' (length=13)
object(gapiReportEntry)[6]
private 'metrics' =>
array (size=3)
'goalCompletionsAll' => int 9744
'goalConversionRateAll' => float 661.05834464043
'goalValueAll' => float 0
private 'dimensions' =>
array (size=2)
'pagePath' => string '/price.php' (length=10)
'hostname' => string 'www.example.com' (length=13)


What I see on Google Analytics website on Goals URLs page with the same period of date is:

Goal Completion Location Goal Completions Goal Value
1. /price.php 9,396 [CO].00
2. /saloni.php 3,739 [CO].00


As you can see outputs doesn't match. Why? What's wrong?

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Annie201

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme