Skip to main content

How to import container

To transfer data from Google Tag Manager (GTM) to your analytics suite, you need to create GTM tags. While you can manually create these tags in the GTM service, our module simplifies this process by allowing you to import pre-configured containers directly into your GTM account. This configuration includes GA4 (Google Analytics 4), making it easier to set up tracking and send data to Google Analytics.

Before importing the container, ensure you have the following information configured in your GTM configuration:

  • Google Tag Manager Account ID
  • Google Tag Manager Container ID
  • Google Analytics 4 Measurement ID

You can configure these values in your Magento admin panel under Stores -> Configuration -> Google Tag Manager.


Get Google Tag Manager Account ID and Container ID

  1. Log in to your Google Tag Manager account.
  2. From the main dashboard, select the appropriate account.
  3. Your Account ID can be found in the URL - numbers after /accounts/.
  4. The Container ID can be found in the URL - numbers after /containers/.
  5. Paste these values in corresponding fields.

Google Tag Manager Account ID and Container ID

Google Tag Manager Account ID and Container ID


Get Google Analytics 4 Measurement ID

  1. Log in to your Google Analytics account.
  2. Navigate to the Admin section from the left-hand menu.
  3. Click on Data Streams under the Data collection and modification section.
  4. Select your Web Data Stream, where you'll find the Measurement ID listed at the top. It will be in the format G-XXXXXXX.
  5. Paste this values in Google Analytics 4 Measurement ID field.

Google Analytics 4 Measurement ID

Google Analytics 4 Measurement ID


Steps to Import the Container

Once you've gathered this information, you can download and import the file.

  1. In your Magento 2 admin panel, navigate to Stores -> Configuration -> Google Tag Manager -> Container import.
  2. Press Download import file for Google Analytics 4 to download the pre-configured container file.
  3. Go to your Google Tag Manager account.
  4. Select the GTM account and container where you want to import the pre-configured setup.
  5. In your GTM dashboard, click on the Admin tab in the top navigation bar.
  6. Under the Container column, click on Import container.

    Admin section

    Admin section

  7. In the Import container screen, click Choose container file and select the file you downloaded from your Magento store.
  8. Choose the appropriate workspace where the container will be imported.
  9. Select Merge if you want to keep existing tags or Overwrite to replace all existing tags with the new container setup.

    Import container

    Import container

  10. Click Add to workspace to proceed.
  11. Review the imported tags, triggers, and variables to ensure they meet your requirements.
  12. Once satisfied, click Submit to publish the container and make it active on your site.

    Submit changes

    Submit changes

You have now successfully imported the pre-configured container into your Google Tag Manager account, making it easier to track user behavior and conversions.