The API Key is only needed once per web application
Visit the Easy Setup Tool Google API Setup Tool *
* Note: If you don't visit the Easy Setup tool you will need to create a project that has access to Analytics API
Select Create Project (or select an existing project)
Then Click Go To Credentials
Select Analytics API for "which API you will be using?"
Then Select "Web Server" as the answer to "Where you will be calling the api from?".
Select "User data" to the question "What data will you be accessing?"
Click "What credentials do I Need?"
Name the credential.
Set the AUTHORIZED REDIRECT URIS to the following 4 sets of URIs (it is advised to only use https for production sites)
Click Create Client ID
Enter Product Name such as "GA Popular Pages" *
* You can also enter extra information that will be displayed on the Oauth2.0 Consent Screen under more Customization Options (not necessary)
Click Download to save the file as client_secret.json.