dsgdfh302506 2017-08-14 04:22
浏览 86
已采纳

使用PHP从谷歌分析导入反向链接

I'm trying to import my backlinks from Google Analytics API with PHP. I have tried with the Analytics API, but I can not find the correct data. In search console, I can find all the links to my page, but from Analytics ga:FullReferrer, I only get links that others have clicked to come to my page. It's not the same list at all.

I have tried https://ga-dev-tools.appspot.com/query-explorer/ and can not find the correct list. Do I look in the wrong places? Is there another API for Google Search Console?

function getResults($analytics, $profileId) {
  $optParams = array(
    'dimensions' => 'ga:fullReferrer, ga:source',
    'max-results' => '50000');

  return $analytics->data_ga->get(
      'ga:' . $profileId,
      '2005-01-01',
      'today',
      'ga:sessions', $optParams);
}

This returns links people have clicked. But I want the list from Google Search Console "Links to your page".

Any help is much appreciated - thanks.

  • 写回答

1条回答 默认 最新

  • doucaishou0074 2017-08-14 04:31
    关注

    from Analytics ga:FullReferrer, I only get links that others have clicked to come to my page

    Google Analytics only records interactions with your page, so this is by design. Search console has an API, too, but judging from the documentation this will not give you referrer info.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部