Setting up Google Analytics 4 for Shopify apps with BigQuery integration
This guide provides steps for integrating Google Analytics 4 with your Shopify app, focusing on efficient transition and BigQuery linkage.
Transitioning to Google Analytics 4 from Universal Analytics
Step 1:
Existing Universal Analytics users should use the Setup Assistant for easy migration to Google Analytics 4. New users will need to establish a new property from scratch. To locate the Setup Assistant, use the search function for quick access.
![](/images/docs/ga_assistant.png)
Step 2:
Post-migration, access your Google Analytics 4 property and navigate to Data Collection and modification -> Data streams. Choose the pre-created stream from the migration or create a new one.
![](/images/docs/ga_data_streams.png)
Step 3:
Ensure the stream URL matches your listing URL. Copy the measurement ID and set up the Measurement Protocol API by generating a new API secret.
![](/images/docs/ga_web_stream.png)
Step 4:
In your Shopify App listing, input the Tracking ID and API secret. Save and verify the setup.
![](/images/docs/ga_shopify_listing.png)
Step 5:
Return to Google Analytics, go to Reports -> Realtime, and observe the Event Count by event name as you initiate an app install.
![](/images/docs/ga_event_name.png)
Step 6:
Optionally, mark the ‘Add App’ button event as a conversion in Google Analytics 4 settings.
![](/images/docs/ga_add_app_button.png)
BigQuery integration with Google Analytics 4
Step 1:
Create a Google Cloud platform account at no cost.
![](/images/docs/google_cloud_dashboard.png)
Step 2:
Create a new project in your account and verify BigQuery activation.
![](/images/docs/google_cloud_new_project.png)
Step 3:
To locate BigQuery within Google Cloud, simply use the search term “BigQuery”:
![](/images/docs/bigquery_search.png)
The Sandbox icon will be displayed and certain features may not function properly until an account with billing setup is established.
To remove the Sandbox label, you must link a billing account with a valid credit card. You will not incur any charges, and the account will be compatible with GA4.
![](/images/docs/ga_bigquery_sandbox.png)
Add a billing account to activate full BigQuery features with Google Analytics 4.
Click Start Free to start a free trial:
![](/images/docs/google_cloud_billing.png)
Important: To avoid any interruptions in service from your BigQuery account, make sure to activate the account as well:
![Activate BigQuery billing button](/images/docs/bigquery_activate_billing_button.png)
![Activate BigQuery billing modal](/images/docs/bigquery_activate_billing_modal.png)
Step 4:
After billing is setup, link BigQuery to your Google Analytics 4 project:
![](/images/docs/ga_bigquery_link.png)
selecting Daily and streaming options for up-to-date data access:
![](/images/docs/ga_bigquery_data_access.png)
Integrating BigQuery
After following the instructions on how to set up Google Analytics GA4 with the BigQuery link they’ll need to grant access to mantle to access the Bigquery data within this GA project.
-
Ensure GA4-BigQuery Setup: Confirm that Google Analytics GA4 is properly set up and linked with BigQuery.
-
Access IAM Manager: Go to the Google Cloud Console IAM Manager and select your GA project.
-
Granting Access to Mantle:
- Navigate to the ‘Add’ section to grant access to a new principal.
- Use the email
[email protected]
for Mantle’s service account. - Assign the roles of “BigQuery Data Viewer” and “BigQuery Job User” to enable viewing and processing of BigQuery data.
For detailed role assignment instructions, refer to Granting an IAM Role in the Console.
Authenticating Mantle
With the preliminary setup complete, you are now ready to authenticate Mantle with your BigQuery project. This process is quick and straightforward:
- Locate your Project ID within BigQuery via your Google Cloud dashboard:
![](/images/docs/google_cloud_project_number.png)
-
Then in your Mantle dashboard, go to the Settings menu.
-
Select the Integrations option.
-
Connect to BigQuery:
- Locate the Google BigQuery integration section.
- Click on Connect to initiate the authentication process:
![](/images/docs/connect_bigquery.png)
- Enter Project ID:
- In the prompt that appears, input the Project ID of your BigQuery project. Mantle will then authenticate with BigQuery.
![BigQuery integration modal](/images/docs/bigquery_integration_modal.png)
![BigQuery integration modal with content](/images/docs/bigquery_integration_modal_content.png)
After linking Google Analytics to BigQuery, data transfer begins within 24 hours. However, this integration only includes new data post-linkage and does not import historical Google Analytics data.
By following these steps, Mantle will be successfully authenticated with BigQuery, enabling seamless data integration and management.