Setting Up Google Analytics

Google Analytics report in admin area is powered by google analytics, so you will need to register for google analytics and add the relevant credentials to the settings page.

Getting Measurement ID

If you only want to enable tracking on your site and don't want to view analytics in the admin area, you only need to enter measurement ID in settings page and can skip the rest of this article.

Getting Service Account Key File

To get service account key file, head over to Google API's site and create or select a project.Next, you will need to enable "Google Analytics Data API". Click on "Library", find the "Google Analytics Data API", select it and then click "Enable".Now that you've created a project that has access to the Analytics Data API, download a file with the credentials. Click "Credentials" in the sidebar and "CREATE CREDENTIALS" button. You'll want to create a "Service account".

On the next screen you can give service account a name. You can name it anything you'd like. In the service account id you'll see an email address. Note this address as it will be needed later on.

Next, select "Project > Owner" Role.

Click "Continue" and then "Create. When Service Account is created, click edit button next to it, click "Keys" => "Add Key" => "Create new key", select "JSON" as the key type and click "Create" to download the .json key file.

You will need to upload this file from "admin > settings > analytics" page on your site later on.

Granting permissions to your Analytics property

Go back to google analytics site and "Property access management" page in the Admin-section of the property.

Add a new user using email address you have saved earlier. Make sure you use google service account (ending with .iam.gserviceaccount.com) and not personal email address.

Getting the property ID

The last thing you'll have to do is fill in credentials in "admin > settings > analytics" page. You have service measurement ID and service account .json file from earlier, get Property ID from "Property Settings" in the Admin-section of the property on google analytics site.