Set up your Google tag with WordPress Editor

Before you can set up your Google tag with WordPress Editor, you need to add the Google tag code snippet on every page on your website, in the <head> section of your HTML pages.

Start by copying your tag snippet. You can find the Google tag snippet in the “Install Manually” section of your “Set up your Google tag” instructions. Then paste into the <head> section of every page on your website.

A UI screenshot showing where to find the Google tag snippet.

Here’s an example of a Google tag snippet:

<script async
src="https://googletagmanager.com/gtag/js?id=TAG
_ID"></script>

<script>

window.dataLayer = window.dataLayer || [];

function gtag(){dataLayer.push(arguments);}

gtag('js', new Date());

gtag('config', 'TAG_ID');

</script>

Instructions

  1. Log in to your WordPress website. Make sure that your site is publicly accessible (your site isn't in maintenance mode or only accessible through a password).
  2. In the left side Navigation panel of your site dashboard, click Appearance

    A graphic highlighting the "Appearance" tab in Wordpress.

  3. Under Appearance, click Theme File Editor

    A graphic showing the "Theme File Editor" tab in Wordpress.

  4. On the right side panel click Theme Header (header.php) under Theme Files

    A graphic showing the "Theme Files" section in Wordpress.

  5. Paste your Tag snippet at the bottom of the code editor

    A graphic showing where to paste the tag snippet in the code editor in Wordpress.

  6. Click Update File and make sure you see a banner “File edited successfully”.

    A graphic showing the "Update File" button under the code editor in Wordpress.

If you change your WordPress theme, you must repeat this process again as the header.php might be overwritten.  

Was this helpful?

How can we improve it?
Search
Clear search
Close search
Google apps
Main menu
1985488380469146922
true
Search Help Center
true
true
true
true
true
69256
true
false