Track method appends querystrings

Vote:
 

I want to turn on general statistics for Find and I understand that it´s done by adding the Track method to a search query. I have two real projects where statistics is enabled and they are running different Find versions, 11.1.2.4113 and 12.3.1, I also have an Alloy test project which runs Find version 12.3.2. My issue is that on the real client projects the querystrings added by the Track method does not get redirected to the friendly url but is kept in the browsers address bar when clicking on a link in the search result, this is really ugly. On the Alloy site the redirect to the clean friendly url after clicking a link which has the querystrings in the search result link works fine.

From what I could understand from this blog post (http://dmytroduk.com/techblog/statistics-tracking-in-episerver-find) the redirect to the clean friendly url should be standard and not something you need to configure or otherwise enable.

Have anyone encountered my issue? Why is the behaviour different between the solutions?

#174577
Jan 30, 2017 20:04
Vote:
 

I finally found the cause of this issue and though I´d post it for future reference.

The cause is quite custom and will not apply to "standard" implementations. Apparently one of our front end developer made the decision to download and modify the Find scripts and usage of them for two main reasons:

  1. The default loading of the scripts was blocking other resources on the application, causing unnecessary longer response times
  2. The scripts themselves weren´t minified enough, causing them to be heavier than needed

Basically, what he did was:

  1. Downloaded the scripts for the Find version we have
  2. Added a C# class which ensures that these scripts aren´t loaded by default for above reasons
  3. Added an inline script which tells the application that the Find scripts exists even if they don´t because otherwise we get a script error
  4. Loaded the Find scripts on the event DocumentReady instead

The Find scripts triggers on the event OnLoad which was never triggered when he did the above, so he modified the scripts to skip the OnLoad event and just run the logic anyway (beacuse we know that the scripts are loaded on DocumentReady when everything is done). So now we have working tracking on the site without the ugly querystrings sticking to the address bar when clicking on a search result.

#178043
Edited, Apr 27, 2017 15:16
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.