Add Google Tag Manager to WordPress

Contributors

@jiteomaregmail-com @ali-al-difaie


Business Benefits

Get insights into user behavior.


Install and activate a plugin that adds tracking scripts to page headers and footers.

Examples of such plugins are Insert Headers and Footers, Header and Footer Scripts, Head, Footer and post injections, and Head and Footer Scripts Inserter.

Open your Google Tag Manager container and click on the code in the top right corner that begins with GTM.

A pop-up window will open with Google Tag Manager container code snippet:

Copy the `` section code and paste it into the head or header field of the WordPress plugin you chose.

In GTM, copy the second code snippet , then paste it immediately after the opening of the tag in the WordPress plugin you chose. Click on Save.

In GTM, click on Submit at the top right, give your version a name, and click on Publish.

Click on Preview in the top right corner of your GTM workspace, type your URL and start previewing your website to test the code.

Your tags should appear. If they don’t, perform the action that should trigger them. For example, filling a form if you’re trying to track form fills.