How can I connect my new Webflow site pages with GA4 for tracking page hits and obtain the replacement analytics code to place on the site?

TL;DR
  • Set up a new GA4 property in Google Analytics, configure data streams, and obtain the GA4 tracking code.
  • Log in to Webflow, access Project Settings, and paste the GA4 tracking code in the Custom Code section under the head tag.
  • Re-publish your Webflow site to start tracking with GA4.

To track your Webflow site with GA4, you'll need to integrate the new tracking code into your site. Here's how to obtain and use the Google Analytics 4 tracking code.

1. Set Up GA4 in Google Analytics

  • Log in to your Google Analytics account and select the desired account.
  • In the Admin panel, navigate to the Property column and click on Create Property to start the GA4 setup.
  • Enter your property name, select your reporting time zone, and choose the currency settings for your site.
  • Click Next and provide business information if prompted, then finish the setup.

2. Obtain the GA4 Tracking Code

  • In Admin Panel, under the Property column, click on Data Streams and select your web stream or create a new one.
  • Once your data stream is configured, locate your Measurement ID at the top right corner.
  • Click on View Tag Instructions, then on Global Site Tag (gtag.js) to view instructions.
  • Copy the generatedgtag.js script, which includes your Measurement ID.

3. Embed GA4 Tracking in Webflow

  • Log in to your Webflow dashboard and open your project.
  • Go to Project Settings and navigate to the Custom Code tab.
  • Paste the gtag.js script in the Head Code section to ensure it loads on every page.
  • Save changes and re-publish your project for the script to take effect.

Summary

To connect your Webflow site pages with GA4, set up a new property in Google Analytics, collect the GA4 tracking code, and embed it in your Webflow site's Custom Code section under the head tag. Re-publish your site to begin tracking page hits using GA4.

Rate this answer

Other Webflow Questions