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.
1. Go to this url. You will be prompted to login to your google account or create a new one if you don't have it already.
2. If there are no properties for this account yet, click "Start Measuring" button, otherwise click on "Admin -> Create new Property" .
3. From "Data Streams" section select "Web", enter your site url and click "Create stream" button.
4. "Measurement ID" is the value you will need to enter in settings page later.
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.
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.
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.
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.