Skip to main content

Integrating Google Analytics and Google Tag Manager codes into CMS?

Integrating Google Analytics and Google Tag Manager into the CMS is essential for tracking website traffic and managing marketing tags efficiently. This guide provides step-by-step instructions to help you correctly add these codes to your CMS settings.

Overview of Google Analytics and Google Tag Manager

  • Google Analytics (GA4): A tool for collecting and analyzing website traffic data. The GA tag (gtag.js snippet) is used for tracking sitewide traffic.

  • Google Tag Manager (GTM): A container snippet that allows centralized management of multiple tags (including GA) and marketing pixels without editing site code each time.

Step-by-Step Guide to Obtain the Google Analytics Tag

To integrate Google Analytics, you first need to obtain the tag code from your Google Analytics account:

  1. Log in to your Google Analytics account.

  2. Navigate to the Admin section.

  3. Under Data collection and modification, click Data streams.

  4. Select Web and choose the data stream for your website.

  5. Under Google tag, click View tag instructions.

  6. On the Installation instructions page, select Install manually.

  7. Copy the JavaScript snippet provided (starting with <!-- Google tag (gtag.js) --> and ending with </script>). This is your Google Analytics tag code.

Adding the Google Analytics Code to Your CMS

Follow these steps to integrate the Google Analytics code into your CMS:

  1. Log in to CMS and navigate to Settings.

  2. Go to the Custom Code section.

  3. Locate the Google Analytics tab.

  4. Paste the entire Google Analytics tag code (gtag.js snippet) into this section.

  5. Save your changes.

Adding the Google Tag Manager Code (Optional)

If you prefer centralized tag management, you can use Google Tag Manager instead of directly adding the Google Analytics tag. To do this:

  1. Obtain the GTM container snippet from your Google Tag Manager account.

  2. Navigate to Settings > Custom Code in CMS.

  3. Paste the GTM container snippet into the Google Tag Manager section.

  4. Save your changes.

Common Mistakes and Troubleshooting Tips

  • Incorrect Placement: Ensure the Google Analytics code is placed in the Google Analytics section, not the Google Tag Manager section, unless you are using GTM for centralized management.

  • Delayed Data Population: After adding the code, it may take up to 24 hours for data to appear in the Google Analytics dashboard.

  • Using Both GA and GTM: If you use both, ensure the GA tag is managed within GTM to avoid duplicate tracking.

Did this answer your question?