0

Recently I had a problem where a client of mine sent out an email with MailChimp containing UTM (Google) and MC (Mailchimp) parameters in the URL.

Since the link was pointing to a Magento 2 site with Varnish running, I had to come up with a fix for that, otherwise Varnish would create a lot of different entries for the "unique" URL's.

Now, by using this adjusted snippet in the Varnish .vcl, I was able to strip these parameters:

if (req.url ~ "(\?|&)(gclid|cx|ie|cof|siteurl|zanpid|origin|mc_[a-z]+|utm_[a-z]+)=") {
    set req.url = regsuball(req.url, "(gclid|cx|ie|cof|siteurl|zanpid|origin|mc_[a-z]+|utm_[a-z]+)=[-_A-z0-9+()%.]+&?", "");
    set req.url = regsub(req.url, "[?|&]+$", "");
}

And this works pretty good, it strips the URL.

BUT, I can't seem to find a correct explanation if this in any way will affect SEO, or Analytics tracking - I tried Googling it as much as I could, but cannot find a clear explanation.

Anyone here with a solution and / or explanation?

TommyK
  • 23
  • 5
  • 3
    I'm voting to close this question as off-topic because it is about SEO, not programming. SEO questions may be asked on [Webmasters.SE](//webmasters.stackexchange.com/) – Machavity Jul 25 '17 at 14:38

1 Answers1

0

This will not affect SEO in any way. Those links are typically added by Google itself (Analytics, Adwords) or email marketing campaigns which use the same. The search engines will not see those links so there's no impact on SEO whatsoever.

The parameters mentioned are used by Javascript libraries and never by the PHP scripts, so what you did for better cacheability is correct. Browser's Javascript engines will still see them because they have access to full URL. The PHP backend (Magento) does not need them.

Danila Vershinin
  • 8,725
  • 2
  • 29
  • 35
  • Hi Daniel. Thanks for the clear explanation. I was a bit unclear if the JS engines actually got the full URL, but that should be since I do all this in vcl_recv. (Was your snippet that I adjusted and used by the way, so thanks for that one too ;) ) – TommyK Jul 25 '17 at 10:26