Steps to create a server key from Google

Once reporting API is enabled, create a new server key under credentails

Download this server key in JSON format file. This file looks like this.

The last step is to create a user on Analytics with server key information. Under your Admin > your property > User Management, create a new user with client_email mentioned in server key.

Once all steps are done, you are ready to implement your integration.

NodeJS Example Code for integration

Request Composer

There is a good way to create and test your request before implementing it in your actual code by using Request Composer provided by Google. You can create your actual request APIs specific to your business here and see your response results as well.

In case of any questions/concerns, please feel free to leave a comment below.