- Go to https://console.developers.google.com/apis/dashboard and create a new project.

step1

 

step2

- Select your project and click on "ENABLE APIS AND SERVICES":

step3

- Enable API:

step4

step5

- Generate service account key and select role Viewer

step7step6

- Open JSON file and copy its content, then go to /admin/settings/general and update JSON credentials data for Analytics plugin: 

step8

- Go to Google Analytics account: https://analytics.google.com/analytics/web/. Click on "Admin" => "View Settings" and copy "View ID" number, then go to /admin/settings/general and tab "Google Analytics" and paste to field View ID.

- Open JSON credentials file and copy client email. Then click on "User management" and add that email to list account. Just need view only permission.

step9

step10

step11

Give your comment here if you got any problem.

Good luck!