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.