Get Embed Codes for Google Tools

Google Tag manager

Embedding Google Tag Manager lets you manage tracking codes without editing your site’s code. It helps with analytics, ad tracking, and user behavior insights while keeping your site efficient and flexible.

How to get the embed code for Google Tag Manager

Before you begin

  1. Sign in to your Google Account. Learn how to create a Google Account.

  2. Open the Tag Manager container you want to edit. Find your way around Tag Manager.

  3. In the Workspace tab, select your container ID (which starts with 'GTM').

  1. In the Install Google Tag Manager dialog, copy the first block of code.

Example Code In the following sample HTML code, you would paste your first Google Tag Manager code snippet after the opening <head> HTML tag. Note that the following example uses 'GTM-ABCDEFGH,' but you must replace the ID with your container ID.

<!DOCTYPE html> <html lang="en"> <head> <!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-ABCDEFGH');</script> <!-- End Google Tag Manager --> <title>Example Webpage</title> </head> <body> <!-- Content of your website --> <h1>Welcome to My Website</h1> <p>This is a sample paragraph on my webpage.</p> </body> </html>

How to Add Custom Code in Wegic Site Settings

Then open another browser tab, and complete the following steps in Wegic:

  1. Log in and go to your Wegic Workspace

  2. Find the site you want to verify and click ⚙️ to open the Site Settings.

  3. Scroll down to the bottom of the page > Custom Head Code

  4. Paste the embed code in the Head Code field

  1. Click [Save] the changes

  2. Go back to the edit page and [Publish] your site

Test your website in GTM workspace

Now, let's go back to Google Tag Manager Workspace:

  1. Test your website by entering your website's link and then clicking Test.

  2. Click OK.

Last updated

Was this helpful?