Please follow the directions noted below to integrate Google Analytics with your HubSpot Marketing account. Following the steps below will add your Google Analytics code to your HubSpot pages.
First, you will need to obtain your Google Analytics Tracking ID.
- Log into your Google Analytics account.
- Click the admin gear in the bottom left corner > select the desired domain to track under the Property dropdown > click on Tracking Code.
- On the following page, copy your Tracking ID.
After you have obtained your Google Analytics Tracking ID, return to HubSpot.
To apply your Google Analytics tracking code to all pages on all domains or all pages on a specific domain:
- Navigate in HubSpot Marketing to Content > Content Settings.
- Under Select a Domain to Edit, you can either select Default for All Domains to apply the Google Analytics code to all pages or select a particular domain so the code only applies to HubSpot pages using that domain.
- Scroll down to Google Analytics, and check off the box to Integrate with Google Analytics.
- Next, paste your Google Analytics Tracking ID.
In some instances, users have customized Google Analytics codes for other purposes. In the case you have a customized Google Analytics account, do not use the Tracking ID. Simply copy your Google Analytics Tracking Code instead and insert it in the the Site Header HTML section.
- Locate the Site Header HTML code box > paste the Google Analytics code into the box > scroll down and click the Save changes button to finish.
- Navigate to Content > Content Settings.
- Select Blog from the left-hand menu.
- Choose the blog to which you'd like to apply the Google Analytics tracking code from the Select a blog to modify dropdown.
- Scroll down to the Header HTML for Blog Listing Pages field and paste your Google Analytics tracking code into the box.
- To apply the code to your blog posts as well, check the Use same header HTML for blog posts box or, if you use different code snippets for your listing pages and blog posts, paste the Google Analytics tracking code into the Header HTML for Blog Posts box.
- Scroll down and click the Save changes button.
- Content > Landing Pages or Website Pages, locate the page in question and access it for editing.
- Under the Settings tab, paste the Tracking Code (not the Tracking ID) in the Head Section HTML section under Advanced Options. When ready, click on Publish/Update Page button to finish.