PHP Problem with Google Analytics
<p>Hey, I'm having some trouble with this code for retrieving Google Analytic data.</p>

<pre><code>if($_GET['month'] || $_GET['year']):
    $month = (int) $_GET['month']; if(!$month) { $month = 1; }
    $year = (int) $_GET['year']; if(!$year) { $year = date('Y'); }
    require 'ga/analytics.class.php';
    $analytics = new analytics('email@domain.com', 'password');

    $analytics-&gt;setProfileByName('mysite.com');

    $analytics-&gt;setMonth($month,$year);
    $visits = $analytics-&gt;getVisitors();
    $views = $analytics-&gt;getPageviews();
    if(count($visits)) {
        foreach($visits as $day=&gt;$visit) { 
            $flot_datas_visits[] = '['.$day.','.$visit.']';
            $flot_datas_views[] = '['.$day.','.$views[$day].']';
        }
        $flot_data_visits = '['.implode(',',$flot_datas_visits).']';
        $flot_data_views = '['.implode(',',$flot_datas_views).']';
    }
endif;
</code></pre>

<p>I keep getting this error:</p>

<p><strong>Fatal error: Uncaught exception 'Exception' with message 'No profile ID found!'</strong></p>

<p>Any help would be great, Thanks!</p>
