How can you modify the URL for the current page that gets passed to Google Analytics?
(I need to strip the extensions from certain pages because for different cases a page can be requested with or without it and GA sees this as two different pages.)
For example, if the page URL is http://mysite/cake/ilikecake.html
, how can I pass to google analytics http://mysite/cake/ilikecake
instead?
I can strip the extension fine, I just can't figure out how to pass the URL I want to Google Analytics. I've tried this, but the stats in the Google Analytics console don't show any page views:
pageTracker._trackPageview('cake/ilikecake');
Thanks, Mike
Step 1: Navigate to https://analytics.google.com and go to the existing Google Analytics Property you'd like to change the domain name for. Step 2: Click on the Admin Cog in the bottom left of the main menu. Step 3: In the middle column, click Property Settings. Step 4: Change the Property Name and the Default URL.
Update view name, time zone, Site Search parameters, and other settings. After you create a view, you can edit its settings. Note that there are more view settings for web properties than there are for app properties. If you're editing a view within an app property, many of the options listed below don't appear.
You could edit the GA profile and add custom filters ...
Create a 'Search and Replace' custom filter, setting the filter field to 'Request URI' and using something like:
Search String: (.*ilikecake\.)html$
Replace String: $1
(was \1
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With