Reputation: 533
i have many database generated pages having different url's. all these are currently tracked by calling
_gaq.push(['_trackPageview']);
I want to now track these pages as one but I can't remove the existing _trackPageview call. So I decide to add a new call so that I'll have two calls to _trackPageview, as:
_gaq.push(['_trackPageview']);
...
_gaq.push(['_trackPageview',static_url]);
will this work. will this track two pageviews for the same page?
Upvotes: 2
Views: 1185
Reputation: 417
If you use Google Tag Manager you can set up firing rules for each page so each page generates a separate firing event. This also means you can manage your tags from within GTM so you don't have to update the tags on each page every time you want to make a change, as long as the GTM container code is on each page. Using filters from within Google Analytics means you don't need different profiles.
Upvotes: 0
Reputation: 324
Yes, your current implementation should double count the pageviews for each page, which probably isn't what you want.
If you can't get rid of the first call, I suggest creating a new separate profile and sending the second page call to this new profile so at least it's tracked independently. The best way to do this could be through adding a prefix on the second tracker:
_gaq.push(['_trackPageview']);
...
_gaq.push(['b._setAccount', 'UA-XXXXXXXX-2']);
_gaq.push(['b._trackPageview']);
Here's a reference where something similar is discussed: http://productforums.google.com/forum/#!category-topic/analytics/discuss-google-analytics-features-with-other-users/5nDlmeAriIw
Upvotes: 1