How do I add Google Analytics 4 to my HubSpot theme?

In Settings, under Website Pages, click the Integrations tab and check the box Integrate with Google Analytics 4 then enter your measurement ID

Google Analytics tracking is theme independent and can be added to your website via HubSpot Settings under Website > Pages > Integrations by checking the box Integrate with Google Analytics 4:

hubspot-google-analytics-4-settings

If you are using Google Tag Manager (GTM), we recommend using the Integrate with Google Tag Manager option instead and configuring your GA4 tag directly in GTM for improved performance related to third-party scripts.