February 22, 2017 by Elena Zlateva

Sitecore Analytics and Google Query URL Structure

We noticed that our Sitecore analytics reports seemed off in terms of how much search traffic we were getting. For some reason, Sitecore was not registering traffic coming from Google as search traffic. This is bad for many reasons; Google is pretty popular, so not having an accurate read on the traffic to a website can cause major problems.

 A woman looking at a screen displaying analytics

 After some digging through the Analytics pipelines, it turned out that Sitecore was expecting a Google search referral to look like this: www.google.com/?q=keywords

  But when I visit Google and perform a search, the resulting URL is: https://www.google.com/#q=keywords

  As you can see, it’s a small change with a big impact. With that URL as referral, Sitecore fails to parse keywords out, and therefore does not register the referral as Search traffic type.

It seems at some point Google changed the URL structure for queries, and Sitecore needs to be updated accordingly.

I added this additional processor to the <parseReferrers> pipeline after the existing ParseGenericSearchEngine.

Screenshot of code with additional precessor for Sitecore Analytics and Google Query URL Structure

With this change, keywords will be parsed and assigned to the Interaction, which will get picked up by the <trafficType> pipeline and it will in turn recognize the referrer as search traffic.

These changes will reflect in the Online channels and Keywords reports in Sitecore.

Keep in Touch and Stay Informed

Get updates, industry reports, white papers and more Hedgehog love.