To upgrade a Shopify store to Google Analytics 4, follow these simple steps:
- Set up a new Google Analytics 4 property in your Google Analytics account.
- To install the Google Analytics 4 tracking code on your Shopify store, you can use the Google Tag Manager app in Shopify.
To use Tag Manager in Shopify:
- Create a Google Tag Manager account.
- In Shopify admin, go to Online Store > Preferences.
- In the Google Analytics section, select "Add custom code".
- Paste the Google Tag Manager code snippet.
- Save your changes.
- In Google Tag Manager, create a new tag and choose "Custom HTML".
- Paste your tracking code snippet.
- Choose "All pages" as the trigger and save.
- Preview and test your tag.
- Publish your changes in Google Tag Manager.
3. Configure the data streams in your Google Analytics 4 property to collect data from your Shopify store and other sources.
To configure data streams in Google Analytics 4 property for your Shopify store:
- Create a Google Analytics 4 property- If you haven't already, create a Google Analytics 4 property by going to the Google Analytics website, signing in, and creating a new property.
- Set up a Shopify integration - To get data from your Shopify store, set up a Shopify integration in Google Analytics 4 by going to "Admin" > "Data Streams" > "Add Stream" and selecting "Web" as your data stream type and "Shopify" as your platform.
- Connect your Shopify store - To connect your Shopify store to Google Analytics, enter your store URL and grant access to your store data.
- Configure your data stream settings- Once your Shopify integration is complete, you can customize your data stream. Choose which events and parameters to track, and add any custom dimensions or metrics you need.
4. To track important actions on your Shopify store, such as purchases and form submissions, set up goals and events in your Google Analytics 4 property.
To set up goals and events in your Shopify store's Google Analytics 4 property, follow these steps:
- In the "Admin" section of your Google Analytics 4 property, click "Goals" or "Events" to track what you need.
- Click "+ Create" to make a new goal or event.
- Name your goal or event and choose the type.
- Configure the parameters of your goal or event, such as the destination URL or form submission fields.
- Click "Save".
- Check the "Real-time" reports in Google Analytics to verify that everything is working correctly.
5. Test your Google Analytics 4 implementation to ensure it is working correctly.
To test your Google Analytics 4 implementation:
- Enable Debug mode: Navigate to Admin > Data Streams > Web > Debugging tab and toggle Debug Mode to On.
- Use Google Analytics Debugger: Install the free Chrome extension and navigate to your website to see a log of events and parameters being sent.
- Test pageviews and events: Navigate to different pages on your website and verify that data is being tracked correctly in the Debugging tab and in Real-Time reporting.
- Test custom dimensions and metrics: Test custom parameter values and verify that data is being collected correctly.
- Test e-commerce tracking: Make a test purchase on your website and verify that purchase data is being collected correctly.
- Validate data in the Analytics interface: Use the Explore tool to create custom reports and verify that data is being collected and processed correctly.
6. After ensuring that your Google Analytics 4 implementation functions properly, you can remove the old Google Analytics tracking code from your Shopify store.