jwaliszko
jwaliszko

Reputation: 17064

Google Analytics and page tracking parameters

Below I've put some calls for page tracking:

  1. _gaq.push(['_trackPageview']) - takes URL listed in the URL bar at the top of the browser
  2. _gaq.push(['_trackPageview', '/sample/url']) - takes sample URL passed as a parameter
  3. _gaq.push(['_trackPageview', '']) - takes what...? (empty string or full URL like in case 1 ?)

I'm wondering if case 3 behaves in the same way case 1 - takes the URL listed in the URL bar at the top of the browser or an empty string ?

Regards

Upvotes: 3

Views: 3406

Answers (1)

Jörg
Jörg

Reputation: 946

Yes, it will handle the trackPageview call as if you did not provide a custom URI.

Open your website on Chrome and use the Google Analytics Tracking Code Debugger

I tried to manually push to _gaq and it logged the following:

_gaq.push(['_trackPageview', '']);
ga_debug.js:12_gaq.push processing : "[_trackPageview,]"

And a bit further down it showed me that the actual browser URI was submitted to Analytics.

Upvotes: 6

Related Questions