Install the Google Tag Manager container in WordPress

  1. Login to Google Tag Manager with your Google account.
  2. Option 1: In Workspace, click on the container’s ID number in the top navigation bar.
    Google Tag Manager: Show Container Code (Option 1)
    Google Tag Manager: Show Container Code (Option 1)

    Option 2: Navigate to Admin and click Install Google Tag Manager.

    Google Tag Manager: Show Container Code (Option 2)
    Google Tag Manager: Show Container Code (Option 2)
  3. Copy the <head> portion of the code to your clipboard.

    Google Tag Manager: Container code (head)
    Google Tag Manager: Container code (head)
  4. Open a new browser tab, go to your website’s WordPress Dashboard and navigate to Appearance > GP Hooks.
  5. Paste the <head> portion of the code into the wp_head area.

    WordPress: GTM container code (head)
    WordPress: GTM container code (head)
  6. Copy the <body> portion of the code to your clipboard.

    Google Tag Manager: container code (body)
    Google Tag Manager: container code (body)
  7. Paste the <body> portion of the code into the Before Header area.

    WordPress: GTM container code (body)
    WordPress: GTM container code (body)
  8. Click Save Hooks.
  9. In Workspace, click Preview.

    Google Tag Manager: Preview
    Google Tag Manager: Preview
  10. Open a new browser tab and load the website’s home page (reload it, if already loaded). The Google Tag Manager container is successfully installed, if you see the debug pane.

    Google Tag Manager: Debug pane
    Google Tag Manager: Debug pane
  11. In Workspace, click Leave Preview Mode and confirm OK to leave.

    Google Tag Manager: Leave preview mode
    Google Tag Manager: Leave preview mode
Share