Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to modify page URL in Google Analytics

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

like image 799
mbrevoort Avatar asked Dec 29 '08 17:12

mbrevoort


People also ask

Can I change stream URL in Google Analytics?

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.

Can you modify Google Analytics data?

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.


1 Answers

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)

like image 87
pelms Avatar answered Oct 12 '22 08:10

pelms