أصبح G Suite الآن Google Workspace: كل ما يحتاج إليه نشاطك التجاري لإتمام العمل.

الصفحة التي طلبتها غير متوفرة بلغتك حاليًا. يمكنك اختيار لغة مختلفة في أسفل الصفحة أو ترجمة أي صفحة ويب على الفور إلى لغة من اختيارك، وذلك باستخدام ميزة الترجمة المضمّنة في Google Chrome.

Add a new container

This article is for anyone who wants to add a new web container to an existing Google Tag Manager account.

If you want to collect metrics from multiple sources, for example the web and an app, you need to create additional containers for each platform.

This page is about setting up a web container. If you want to set up a different container type, refer to the following documentation:

What is a container?

A container consists of multiple tags and rules to govern them. There are specific container types that may be used for:

  • Websites
  • AMP pages
  • Android apps
  • iOS apps
  • Running Tag Manager on a server

1. Create a new container

To add a web container:
  1. Open Tag Manager.
  2. In the Accounts tab, next to the account name, click More Actions More > Create Container.
  3. Enter a descriptive Container name and select the container type.
  4. To create your container, click Create and agree to the Terms of Service.

2. Install the container

The following instructions are for setting up Web containers to track tags on websites. If you are not experienced with code or do not have access to your website or mobile app code, you may need to ask a developer for help at this step.

  1. In Tag Manager, click Workspace.
  2. Near the top of the window, find your container ID, formatted as "GTM-XXXXXX".
  3. Click your container ID to launch the Install Tag Manager box.
  4. Copy and paste the code snippets into your website as instructed in the Install Tag Manager box.
    1. Place the <script> code snippet in the <head> of your web page's HTML output, preferably as close to the opening <head> tag as possible, but below any dataLayer declarations.
    2. Place the <noscript> code snippet immediately after the <body> tag in your HTML output.

If you already use tags on your website, migrate them over to your Tag Manager Container, see 3. Add tags. Make sure that tags do not fire twice by removing any hardcoded tags from your code.

To help protect your container from third party snooping, the Tag Manager web page snippet uses HTTPS by default.

If you have reason to deploy your Tag Manager containers in a way that supports non-secure pages, you may do so by adjusting the source URL protocol in your container snippet to // instead of https://. Learn more about using protocol-relative URLs.

3. Add tags

Now that you installed the container on your website, you're ready to add new tags.

  1. In your Workspace, click Tags.
  2. To add a tag, click New.
  3. Name your tag and configure it:
    • Tag Configuration: Choose the type of tag you want to manage. Google Tag Manager supports tags for Google products and third party tags. If you need more help with setting up a tag from a Google product, refer to Your guide to Google Tag Manager.
      If you no tag type matches, you can create a custom HTML or image tag.
    • Triggering: Triggers govern if a page tag is fired or blocked. Learn more about triggers
  4. Optional: Add a note to your configuration for later reference. To add a note, click the more actions More menu and select Show Notes
  5. Click Save and create more tags as needed.

4. Verify that your tags work

After you have added tags, make sure that they behave as intended. To verify your tag setup:

  1. Click the Preview button. Google Tag Assistant launches in a new tab.
  2. Enter the website URL on which you installed the Tag Manager container. If there are any errors, start debugging with the Tag Assistant.
  3. To edit a tag, click on a tag name to change its settings. For example, when a tag gets fired after a page loaded, but you want it to fire if someone clicks a button, update the trigger.
  4. Save your changed tag and verify that the problem was solved by launching the Preview mode again.

5. Publish tags

When your tags work as intended, publish them.

To publish your current workspace:

  1. Click Submit at the top right hand side of the screen. The Submit Changes screen will appear, with options to publish the container and save a version of your container.
  2. Select Publish and Create Version if it is not already selected.
  3. Review the Workspace Changes section to see if your configuration appears as you expect.
  4. Enter a Version Name and Version Description.
  5. Click Publish.

هل كان ذلك مفيدًا؟

كيف يمكننا تحسينها؟
Clear search
Close search
Google apps
Main menu