使用PHP中的Google Analytics API获取页面顶部引荐? [英] Get Top Referrals for a Page using the Google Analytics API in PHP?
问题描述
我在这里使用在线Google AnalyticsAPI工具来测试从不同指标返回的结果。
上的过滤器语法部分
您的查询是说return metrics where pagepath = ...... OR medium = .....
你想要:
return metrics where pagepath = ...... AND medium = .....
I am using the online Google Analytics API tool here to test results returned from different metrics.
https://ga-dev-tools.appspot.com/explorer/
My goal is to return the Top referrers on a per page basis on my blog site. Generally to get stats related to just a speciofic page I simply use this in the Filters
section...
ga:pagePath==/articles/13-best-code-schools-to-learn-programming-and-web-development/
This will then return whatever results I am fetching but just for the page with the slug...
/articles/13-best-code-schools-to-learn-programming-and-web-development/
Now this generally works however now that I am trying to get the top referrals for this page, it instead returns the top referrals for ALL pages instead!
Can someone help?
Below is an image showing the form filled in and then also list is each section with text...
Dimensions: ga:source,ga:pagePath,ga:referralPath
Metrics: ga:pageviews,ga:sessionDuration,ga:exits
Filters: ga:pagePath==/articles/13-best-code-schools-to-learn-programming-and-web-development/, ga:medium==referral
start: 2012-12-01
end: 2014-12-30
This image below shows my result is instead the top referrals across ALL my pages instead of just the page in my FILTER
Separate the two filters with a semicolon (AND), not a comma (OR). Refer to the filter syntax section on this page
Your query is saying "return metrics where pagepath=...... OR medium=....."
You want: "return metrics where pagepath=...... AND medium=....."
这篇关于使用PHP中的Google Analytics API获取页面顶部引荐?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!