We have enhanced the Google Analytics widget to support integration with Google Analytics 4 (GA4). The updated setup process now leverages the Google Analytics Data API and Google Chart.js library for data rendering, providing seamless GA4 property integration without requiring the traditional View ID.
How it Works
Required Information for Setup
Users will need:
- Google App Credentials (JSON format)
- GA4 Property ID
Steps to Obtain Required Credentials
- Google Cloud Console Setup:
- Visit Google Cloud Console.
- Create a new project.
- Enable the Google Analytics Data API for your project.
- Create a Service Account and generate the Private Key in JSON format.
- Extract the client_email from the JSON file.
- Download the JSON file containing your credentials.
- Extract the client_email from the JSON file (e.g.,
"client_email": "your-service-account[at]project-id.iam.gserviceaccount.com"
).
- Link the Service Account to Google Analytics:
- Log into Google Analytics and navigate to Property Access Management.
- Add the client_email and assign the appropriate role (e.g., Analytics or Admin).
- Retrieve the GA4 Property ID from the Property Settings.
- Base64 Encoding:
- To integrate the credentials with the widget, you need to base64 encode the contents of the JSON file. The tool will generate a long base64-encoded string.
- Widget Configuration in EPC:
- Paste the base64-encoded JSON string (from step 3) into the Google App Credentials field in the widget settings.
- Paste the GA4 Property ID (from step 2) into the GA4 Property ID field in the widget settings.
- Save the changes. The widget will now automatically render the chart using your Google Analytics 4 data.
Hinterlasse einen Kommentar.