Skip to content

Add Google Analytics or scripts (Custom code)

Reign Theme overviewPremiumGet Reign Theme →

Also called: tracking code, Google Analytics, Facebook pixel, header scripts, footer scripts, custom JavaScript, add code, snippets.

Custom Code lets you add your own code to every page of the site, with no extra plugin. Use it to paste Google Analytics, a Facebook Pixel or a few lines of JavaScript. It does not take CSS. CSS goes in Additional CSS.

  1. Go to Appearance > Customize > General > Custom Code.

    The Custom Code section

  2. Paste the code your service gave you into the right field:

    • Tracking Code is added to the <head> of every page. Use it for Google tracking code, a Facebook Pixel, or any analytics or verification tag that gives you a block of HTML.
    • Custom JS : Header takes plain JavaScript, added to the header. Do not add <script> tags.
    • Custom JS : Footer takes plain JavaScript, added to the footer. Use this for most scripts, because it does not hold up the page while it loads.
  3. Click Publish.

The fields are code editors with colour highlighting. Your preview updates as you type.

Your analytics tool shows a visit after you load the site in a private window. You can also view the page source and search for your code.

Paste the snippet Google gives you into Tracking Code. It goes into the page head on every page.

Use Appearance > Customize > Additional CSS, which WordPress provides. Custom Code covers HTML and JavaScript only.

Reign’s own CSS loads first, and your Additional CSS loads after it. So your rule wins without !important, as long as it is as specific as the theme’s rule. If it does not apply, look for a more specific selector in the theme before you add !important. See Changes are not showing on the site.

For a few scripts, Custom Code is simpler. There is nothing to install or update. If you manage many scripts, need to load them only on some pages, or want tag rules, use a tag manager. Then leave these fields empty.