@rhughes8469 opened this Issue on December 15th 2020

When sending an API request to Referrers.getAll, the results returned include: Websites, Social Networks, Campaigns, "no referrer", & Keyword/Search Engines

I'm trying to display a list of referrers from the data that is returned.
For websites and social networks I can display the "URL" as the referrer.
For campaigns I can display the campaign "Label" as the referrer.
For no referrer I can display, "No Referrer"

My issue is with Keyword/Search Engines. The API returns each keyword but does not return which search engine it's from.

How do I know which Search engine to display as the referrer, since a keyword by itself, isn't really a "referrer". And if I omit the keywords from the list of referrers I'm displaying, it won't add up to the number of page views.

@sgiehl commented on December 15th 2020 Member

If Referrers.getAll doesn't include the data you require, you might need to use other API methods maybe. e.g. you can simply use Referrers.getSearchEngines to get a list of search engines that referred visits to your site.

@rhughes8469 commented on December 15th 2020

I’m not sure why this would not be considered a bug.

I know I can use getSearchEngines to get search engine referrers. That’s not the issue.

If I’m trying to pull a list of the top 20 referrers by # of page views, I assume using getAll would return with the actual referrers in order. Keywords are not referrers. The search engine that referred the traffic is.

How would one get the actual referrers in page view order. Make two different API requests, then merge the arrays, and somehow resort the result by visits?

On Dec 15, 2020, at 2:58 AM, Stefan Giehl <notifications@github.com> wrote:


If Referrers.getAll doesn't include the data you require, you might need to use other API methods maybe. e.g. you can simply use Referrers.getSearchEngines to get a list of search engines that referred visits to your site.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

@sgiehl commented on December 15th 2020 Member

I’m not sure why this would not be considered a bug.

It's just how the method is supposed to work. The report this API method is used for actually also says it in it's description: "This report shows all your Referrers in one unified report, listing all Websites, Search keywords and Campaigns used by your visitors to find your website."

How would one get the actual referrers in page view order. Make two different API requests, then merge the arrays, and somehow resort the result by visits?

Guess that's how I would try to achieve that. Unless you don't want to write a simple plugin that uses Matomo internal methods to achieve that...

@rhughes8469 commented on December 15th 2020

Thanks Stefan. I really do appreciate your responses. I would try the plugin route, but my MySQL skills would surely result in a much slower API request that making two and resorting! 😃

This Issue was closed on December 15th 2020
Powered by GitHub Issue Mirror