Tracking data for dynamic pages on the fly ( Google Analytics )
<p>Somewhat confused by GA, I got to thinking .. surely I can track specific dynamic pages on our site.
However looking at the code, its not immediately apparent what can and cannot be tracked, and echoed back for stats and graphics rendition.</p>

<p>So heres the crunch, we have a classified ads site. Our advertisers, can create ads and deploy them. Each ad has an ad id. This is embedded within the page url. ( or can be in any format to give it a unique identity )</p>

<p>So I was looking at the analytics code: ( ours at least )</p>

<pre><code>var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-12345678-1']);
_gaq.push(['_setDomainName', 'ourdomain.com']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);

(function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</code></pre>

<p>What intrigues me is ( _gaq.push(['_trackPageview']); )</p>

<p>Can we uniquely add the id of the page into the trackPageview "bit"
From what I have read across the web and across stack, no one actually has identified a specific page ( esp. dynamic pages ) so say we had a page called <strong>ad_12345.php</strong> ( for example )</p>

<p>Can that be appended dynamically into the GA scripting in the page ( now we server our GA using php includes )</p>

<p>So we would need to set up a var using php I guess, and append that var as a tracking ID into the trackPageview portion ..</p>

<p>Does anyone know how to do this.</p>

<hr>

<p>What are we trying to achieve ?</p>

<p>We wish to give our advertisers the ability, to view stats for their ads. We use gapi to achieve this along with charting. 
We want them to be able to goto their usercp, click one of their listings and goto a page that shows the stats for that particular ad, the only way I see of doing this is to be able to apend ad ids to the GA script itself.</p>

<p>There is nothing confidential given away within our stats graphs, they are purely for the user to see. </p>

<p>Anyhoo .. any ideas please ?</p>
