从 Google API 获取有关我网站上的页面和该页面上的链接的统计信息
Getting stats about a page on my site and links on that page from the Google API
我有一个博客,在各个页面中都带有 Google Analytics 标签。我的网站上也有 links 指向我网站上的页面以及外部页面。我没有设置自定义事件或类似的东西。
对于我网站上给定的 url/page,在特定日期范围内,我想以编程方式获取(最好从 GA API):
从我的网站外部搜索 words/traffic 独特的 users/traffic 资源(例如 Google 上的有机流量搜索)用于登陆并查看该页面
对于该页面上的特定 links - 内部和外部 - 我想知道点击 link 的唯一用户数量和点击次数
对于该页面上的特定 links - 内部和外部 - 我想知道 link 的 users/clicks 的搜索 terms/sources =]s 与未点击 links
的访问者
有什么方法可以将我博客上给定的 link 触发到 Google Analytics API 中以获取此数据?我已经有一个 2 列 table,其中包含我网站上的所有页面(第 1 列)和这些页面上的所有 links/urls(第 2 列)。
顺便说一句,我正在使用 Python。
在此先感谢您的帮助!
关于您正在查找的信息:
- 您不会通过 GA API 获得有机关键字:您大部分时间会得到的是
(not provided)
(here is some info and workarounds). You can get this data in the GA UI by linking the search console, but that data won't be exposed via the GA API, only the Search Console API(以前称为 "webmasters"),很遗憾,您将无法 link 使用您的 GA 数据。
- 如果您想跟踪 link 点击,您将需要实施自定义事件,因为默认情况下 GA 不会这样做(here is an example which you can use for both internal and external links). Once you have the events implemented, you can use the
ga:eventAction
or ga:eventLabel
to filter on your links (depending on how you implemented the events), and ga:totalEvents
/ ga:uniqueEvents
获取总点击次数/唯一点击次数。
- 您将需要创建 segments in order to define conditions about what users did or did not do. What I advise you to do is to create and test your segments via the UI to make sure they're correct, then simply refer to the segments via ID using the API。
至于 GA API 实现,我建议您在编码之前熟悉 API 使用:
获得所需结果后,您可以使用 Google Python Client (it's the same client for (nearly) all Google APIs), GA being a service you use with the client, and you'll find some python samples here 实现自动化。
我有一个博客,在各个页面中都带有 Google Analytics 标签。我的网站上也有 links 指向我网站上的页面以及外部页面。我没有设置自定义事件或类似的东西。
对于我网站上给定的 url/page,在特定日期范围内,我想以编程方式获取(最好从 GA API):
从我的网站外部搜索 words/traffic 独特的 users/traffic 资源(例如 Google 上的有机流量搜索)用于登陆并查看该页面
对于该页面上的特定 links - 内部和外部 - 我想知道点击 link 的唯一用户数量和点击次数
对于该页面上的特定 links - 内部和外部 - 我想知道 link 的 users/clicks 的搜索 terms/sources =]s 与未点击 links
的访问者
有什么方法可以将我博客上给定的 link 触发到 Google Analytics API 中以获取此数据?我已经有一个 2 列 table,其中包含我网站上的所有页面(第 1 列)和这些页面上的所有 links/urls(第 2 列)。
顺便说一句,我正在使用 Python。
在此先感谢您的帮助!
关于您正在查找的信息:
- 您不会通过 GA API 获得有机关键字:您大部分时间会得到的是
(not provided)
(here is some info and workarounds). You can get this data in the GA UI by linking the search console, but that data won't be exposed via the GA API, only the Search Console API(以前称为 "webmasters"),很遗憾,您将无法 link 使用您的 GA 数据。 - 如果您想跟踪 link 点击,您将需要实施自定义事件,因为默认情况下 GA 不会这样做(here is an example which you can use for both internal and external links). Once you have the events implemented, you can use the
ga:eventAction
orga:eventLabel
to filter on your links (depending on how you implemented the events), andga:totalEvents
/ga:uniqueEvents
获取总点击次数/唯一点击次数。 - 您将需要创建 segments in order to define conditions about what users did or did not do. What I advise you to do is to create and test your segments via the UI to make sure they're correct, then simply refer to the segments via ID using the API。
至于 GA API 实现,我建议您在编码之前熟悉 API 使用:
获得所需结果后,您可以使用 Google Python Client (it's the same client for (nearly) all Google APIs), GA being a service you use with the client, and you'll find some python samples here 实现自动化。