less than a minute read • Updated 2 hours ago
Set up Google Analytics 4 and Google Ads Tracking
How to connect Google Analytics 4, Google Ads, or both to track ecommerce events across the cart, checkout, and receipt.
Connect Google Analytics 4 (GA4), Google Ads, or both to track ecommerce events. You add your Google Tag to your own website, then enter your tag ID in the admin.
Before you start
Add the Google Tag (
gtag.js) to every page of your own website you want to track, using the same tag ID you will enter in the admin. Do not add the Google Tag to the cart, checkout, or receipt — it is included there for you.Make sure
loader.jsis on your website (Settings > Website & Products > "Foxy loader.js").Using Google Tag Manager? See Set up Google Tag Manager for ecommerce tracking instead.
Tag ID formats
Google Analytics 4:
G-XXXXXXXXXGoogle Ads:
AW-XXXXXXXXXGoogle Tag Manager:
GTM-XXXXXX
To track GA4 and Google Ads together, add your Google Ads account as an additional destination on your GA4 Google Tag, then use your GA4 tag ID here. Tag IDs prefixed with GT- are not fully supported.
Steps
The section is labeled Google Tag Manager, but it accepts GA4 (
G-), Google Tag Manager (GTM-), and Google Ads (AW-) tag IDs.
Notes
In your Google Tag settings, under "Configure your domains", add every domain the tag runs on, plus your
*.foxycart.comsubdomain if you do not use a custom subdomain.If you use a custom subdomain that matches your website domain, tracking is same-domain and cross-domain cookie issues do not apply.
If you customised your cart, checkout, or receipt templates, confirm the custom code placeholders are present. Tracking is added through the custom footer placeholder.
For the events sent and the data included, see Google Analytics events and item data reference.