I've been trying to integrate the Google Analytics API in my plugin in order to add a column next to the posts dashboard and display the total view count of every post.
So far I've managed to do it by creating a service account and using Google Analytics Reporting API v4 with PHP. But this solution only works with my site, since I need to set up the authorized URLs, the client ID, and download my Client Secret.
While researching I came across the Google Analytics Dashboard for WP by ExactMetrics and the one by Analytify. Both of them are using a Google Service account and the Reporting API but instead of asking all the things I thought I needed the one by ExactMetrics just asks for the user to click a redirect link and copy&paste an 'access code'. And the one by Analytify doesn't even need you to paste a code, just to authorize and select the correct GA Profile.
I've been looking at the code in this plugins and can't really understand how they manage to do it. Couldn't find any relevant documentation either. All the videos and blog posts about working with GA and WP seem to be about making it work on 1 specific site.
Any hints to help me get a sense of direction would be greatly appreciated.