Go to your google developer console and pick the project you will use to work with your website and google analytics:
On your dashboard select Enable and Manage APIs:
Under Other popular APIs select Analytics API:
After selecting Analytics API click Enable API:
On the left hand navigation click Credentials, on the credentials page click New credentials:
After clicking New Credentials select Service account key then pick your service account, pick key type P12 and click create:
Your new key will be downloaded automatically (Make sure you are using Chrome as your browser) you will use this later:
After returning to the credentials page click Manage service accounts:
Copy the email associated with your service account:
Now that you’ve created your new service account you will need to add this ‘user’ to your Google Analytics account.
Login to analytics and then go to the admin dashboard section.
Under the first column labeled ‘Account’ select ‘User Management’. Now go ahead and add the email address that is associated with your service account. It should be in the format email@example.com.
As we will only be using this account to extract data from your Analytics account you can set the user privileges to ‘Read & Analyze’.
Now go back to your Analytics admin dashboard and navigate to the ‘View Settings’ link, located in the third column ‘View’. Take a note of the ‘View ID’, this will be required later.
Now you must go to the your app settings on xtremepush to upload the service account email, cert and your google analytics view ID.
In your web App home on xtremepush go to App Settings > Certs & Keys. Select the GOOGLE ANALYTICS radio button and upload the service account email, cert and your google analytics view ID generated as described above. Select the next available Google Analytics custom dimension (Dimension go from 1-20 for regular GA accounts). Save your settings and your Google Analytics integration is almost complete.
If you already have a dimension that stores GA Client ID just enter the dimension ID and set the mode to be "Read-Only" (so Xtremepush would not automatically populate the dimension).
Otherwise create a new dimension in you Google Analytics dashboard. You can call this anything for example "GA Client ID" just make sure the dimension number on the certs & keys page matches and the scope is User. Set the mode to be "Write & Read", so the Xtremepush SDK would automatically populate the dimension when users are visiting your website.
Alternatively xtremepush can auto generate the custom dimension if you are happy to give the service account user you are using for the integration edit permissions in the user access management section of google analytics.
Then you can leave the custom dimension field blank and it will be auto generated when you save: