Mobile app version of vmapp.org
Login or Join
Ann8826881

: Google Analytics Campaigns - cleanup URL after arriving to webpage? After visitor lands to my webpage using campaign url: http://www.mydomain.com?utm_source=signature&utm_medium=email&utm_campaign=myname

@Ann8826881

Posted in: #GoogleAnalytics #UrlParameters #UrlRewriting

After visitor lands to my webpage using campaign url:
www.mydomain.com?utm_source=signature&utm_medium=email&utm_campaign=myname

Is it possible to do a rewrite to www.mydomain.com to cleanup the URL in the address bar?

Will it still preserve the campaign data if I do a simple mod_rewrite redirect?

RewriteCond %{QUERY_STRING} utm_source
RewriteRule .* www.mydomain.com [R=301,L]


Or how else can I cleanup the URL?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Ann8826881

2 Comments

Sorted by latest first Latest Oldest Best

 

@Margaret670

It's possible by using server side redirection AND by following the instructions on this Google reference page:
developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiCampaignTracking
Please note that the _setCamp... functions must be called before this code:

_gaq.push(['_trackPageview']);

10% popularity Vote Up Vote Down


 

@Heady270

If you redirect, it will not preserve that information. You could store this information in a cookie before redirecting and then read it from a cookie. I worked with a website that did that for URL canonicalization. It works, but it is a pain to implement and some data gets lost or truncated.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme