Products » Knowledge Base » Url Master 

Url Master Help Wiki

Keeping querystring data out of the Url Path


When the Url Master module does an automatic redirect, it can incorporate data that was previously in the querystring into the Friendly Url Path.  This is most often a problem with Urls that track data through variables used by monitoring or analytics systems. 

Here's an example Url:

/my-path.aspx?utm_source=sale&utm_medium=email&utm_campaign=discounts

In this example the my-path.aspx url is being tracked with several variables for Google analytics.

If this were to be redirected, you may end up with a Url that looks like this:

/my-path/utm_source/sale/utm_medium/email/utm_campaign/discounts.aspx

Now, because Analytics works at a client-side (javascript) level, it won't work properly, because it can't access the server-side rewrite of this Url.  In addition to that, it' s harder for search engines to know that the two Urls are actually the same thing, so you can end up with duplicate content problems.

The solution to this problem is to construct a regex pattern for the 'doNotIncludeInPathRegex' value.  When a Url matches this regex, the portion of the Url that is matched will be excluded from the friendly url path - or, if you prefer - will be kept in the querystring.

Here's how you would write it for the example Url:

(/utm[^/]+/[^/]+)+

Note that this regex is matching on what the end-result of the Url is - that is, you are matching against the 'incorrect' value of /my-path/utmsource/sale/utmmedium/email/utmcampaign/discounts.aspx

Because the regex pattern uses the utm prefix to match, the order of the items in the querystring isn't important, and it will match if any one of the types of tracking codes that are in the quersytring.

 You can read how to update the Advanced Regex Settings section (where the doNotIncludeInPathRegex field is) in this article : Modifying Advanced Regex Patterns




 |  View Topic History  |