Login to download the latest version of Mint and your favorite Pepper, purchase additional licenses, or post in the Forum. Don't have an account? Create one!

In Partnership with Media Temple

Mint Forum

Pages recorded as "mazda-3.html?gclid=..." instead of "mazda-3.html"

Using google adwords to advertise and when people click on adwords google attaches ?gclid to all links. But mint doesn’t get rid of this and records a single page multiple times instead of adding the count to the existing page because every adwords click is a different gclid.

How do I get Mint to record:
- mazda-3.html?gclid=COKYr7bzvIwCFRbWYAodxVZGXg
as just plain ol
- mazda-3.html
?

Thanks

well i’ve made a modification to the default pepper.

directly below this line:
$domain = preg_replace('/(^([^:]+)://(www.)?|(:d+)?/.*$)/', '', $referer);

I put this:
$resource = preg_replace('/?gclid=.*/', '', $resource);

Now I just have 13 pages in the pages pepper instead 100+, there are only 30pages on this site, so that’s much better :)

this file is located at:
/mint/pepper/shauninman/default/class.php
and the function that’s being modified is onRecord()

A note of caution, if your site isn’t doing static locations (not .html but asp?id=12&view=12) it’s prbably not going to work for you since the regex looks for ?gclid - not gclid in the querystring. my regex skillz are very poor and i couldn’t figure out a way to just remove gclid and leave everything else intact if there were other querystring parameters. My site is on Joomla CMS but I have the OpenSEF component installed to make static urls

You must be logged in to reply. Login above or create an account