# Google Analytics
Integration with Google Analytics has been introduced to gather and assess data regarding website traffic.
Google Analytics is a service that tracks and reports website traffic. It provides insights into user behavior, it will help you understand how visitors interact with a WordPress website and make data-driven decisions.
# Configuration
Google Analytics requires no installation, so you can instantly proceed to its configuration. To start using the Google Analytics integration, navigate to Configuration → Integrations. Once there, find Google Analytics among the other Site Statistics intergations. Enable it by pressing the switch, and you will be taken to the configuration form immediately.
To complete the required information, namely the Account ID and the Service Account Credentials, please follow the steps below. You will be guided step by step on how to generate these data.
# Google Anlytics Account ID
Go to the Google Analytics (opens new window) website.
Log into your Google account if not already logged in.
Create a Google Analytics account.
You will be guided step by step on the site account creation page. For the purposes of the PanelAlpha system, you may skip the last step (number 5) regarding data collection configuration.Once your account is ready, navigate to Admin → Account Settings → Account Details and find your Account ID as marked on the screen below.
Once you have your Account ID configured, follow these steps to configure the JSON file.
# Google Anlytics JSON file
Navigate to Google Cloud APIs (opens new window) website.
Once there, create a new project by clicking on New Project in the project list.
Open the newly created project, and go to APIs & Services → Library in the left side menu.
Use the search field to find Google Analytics Data API and Google Analytics Admin API. Open each one and click Enable.
After creating a project with access to the Analytics API, you need to obtain a file containing these credentials. Navigate to the sidebar and click on Credentials. Then, select Create Credentials → Service Account.
When filling out the service account details, make sure to copy its email address from the Service Account ID field, as it will be needed later.
- Open your newly created service account, proceed to Keys tab, there click Add Key → Create new key.
- Select JSON as the key type and click Create to download the JSON file.
- Go back to Google Analytics (opens new window) to grant permissions to your account.
- Navigate to the admin section → Property Access Management. Then, click the Plus sign in the top right corner to add a new user.
- Enter the saved email address (refer to step 10) and assign the role of Administrator.
# PanelAlpha configuration
- Now that you have all the required information, go back to the PanelAlpha admin area → Configuration → Integrations → Google Analytics. Paste the Account ID (refer to step 4), and the saved JSON file (refer to step 11) into the Service Account Credentials field in the configuration form.