Skip to content Skip to navigation
Back to the main support

Add Google Tag Manager to your WordPress site with SEOPress

Since SEOPress 3.6.2, you can now add Google Tag Manager tracking code to your site with user consent (if needed) in a minute.

From Google Tag Manager website, Admin, Setup Google Tag Manager, copy the first code (head) using the icon on the right.

Then, go to your WordPress admin, SEO, Analytics, Custom Tracking tab, and paste your code into the field “[HEAD] Add an additional tracking code (like GTM, Facebook Pixel, Hotjar…)“.

Go back to GTM, copy the second part (body) and paste it into the field “[BODY] Add an additional tracking code (like Google Tag Manager…)“.

Save changes.

Clear your cache if you have one.


If you don’t see the second part of the code just after the opening of the body tag, update your theme or manually add this code:

 <?php wp_body_open(); ?>

Paste it after the opening body tag.

You can also use the user consent feature from SEO > Google Analytics > General tab with GTM or any other script.