PageShift Help

Add tracking codes with Code Snippets

Add Google Tag Manager, Meta Pixel, chat widgets and verification tags to your website without editing files, on all pages or only some.

Advertising and analytics tools often ask you to "paste this code into your website". In PageShift you paste it into System → Code Snippets. Snippets run on your public website only, never inside the admin or the page editor. Only Administrators can add them.

Code Snippets

Add a snippet

  1. Go to System → Code Snippets and click Add New.
  2. Give it a name you'll recognize (1), for example Google Tag Manager (body part).
  3. Paste the code exactly as the provider gives it, including the <script> tags, into Code (2).
  4. Under Where it runs (3), choose All pages, Only on the pages selected below or On all pages except the ones selected below. When you choose some pages, tick them in the list, or tick a whole type such as All blog posts (this includes future posts).
  5. Choose the Location (4) the provider asks for (see the table below).
  6. Leave Active (5) on, and click Create Snippet (6).
Adding a snippet
Location Use it for
Inside <head> Google Analytics, Meta Pixel, verification tags (Pinterest, Google, Bing)
Right after <body> The second, "noscript" part of Google Tag Manager
Before </body> Chat widgets and most other scripts

Order decides which snippet loads first when several share a location: lower numbers load first. The default, 10, is fine for most.

If the code looks broken

Before saving an active snippet, PageShift checks the code. If a <script> tag isn't closed, the code contains PHP, or it includes <html>, <head> or <body> tags, it shows what's wrong instead of saving. Copy the code again from the provider and paste it again. If you're sure it's right, tick Save anyway (I know this code is correct), or save it with Active off.

Turn a snippet on or off, edit or delete it

  • Click the switch in the Active column (2 on the first picture) to turn a snippet on or off. Nothing else changes.
  • Click its name to edit it, then Save Snippet.
  • Point at its name and click Delete to remove it for good.

The Change log at the bottom records every change with the date and who made it, so you can trace a problem back to a change.

Written for PageShift 5.99.44. Screens can change a little between versions.