Why is Analytics showing external domains under internal searches?

Modified on: Tue, 10 Aug, 2021 at 7:33 AM

This can happen if the site where Siteimprove is tracking the internal search term is a Single Page Application (SPA). In that case, the pages do not reload when navigation from page to page, therefore it does not reload the script and update the referrer, thus showing the initial page's referrer (the external domain), and not the internal page that lead to the search result page.

How is the internal referrer normally determined?

Analytics internal search uses the referring page to determine where the user performed the search. So, if I go to example.com and perform a search for “hotdogs”, I would normally be lead to a page like e.g. example.com/search?q=hotdogs with example.com being the referring page.

What happens in a Single Page Application?

If example.com is a SPA and I search on Google and then click a link to go to example.com then by default the referrer will be google.com. If I then perform a search for “more hotdogs” which leads me to the result page example.com/search?q=more+hotdogs, because this is a SPA, no new page load takes place, which means no new referrer is determined, thus the referrer is still google.com - and that’s what we will show in the platform.


Can this situation be avoided for Single Page Application websites?

Yes, it is possible to get the referrer in situations like this by configuring the code to reload the page each time the URL changes and thereby updating the referrer. This article on Siteimprove Analytics Custom Visit Tracking explains how this can be done.

If you have any questions, please contact the Siteimprove Technical Support team with your request.