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.
Just make sure to ad a corresponding custom dimension on Google Analytics. You can call this anything for example "xtrempush ID" just make sure the dimension number on the certs & keys page matches and the scope is User:
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:
Deploying the SDK
Once you have configured your Google Analytics integration you are ready to deploy/update the SDK initialisation code. Instructions on how to deploy will be found in Settings > SDK Integration. After you have saved all your settings instructions on how to initialise the SDK will be found here. This will include the JS you need to add to your pages and any manifest, service worker, or html files you may need to add to your websites origin.
The SDK integration page will look different depending on how you have configured for different browsers two example are given below, review the full integration guide for more info on deploying: