Short answer

Install the PubPulse Analytics plugin, paste your data domain (example.com/AbC123) in Settings → PubPulse and save. The plugin adds the script, sends author, category, article ID, title and publish date with every post view, tracks AMP pages and leaves out logged-in editors.

  1. Download the plugin (zip, 7 KB, version 1.0.0).
  2. In WordPress go to Plugins → Add New → Upload Plugin, choose the zip, install and activate.
  3. In PubPulse open Settings → Tracking Code and copy your data domain (it looks like example.com/AbC123).
  4. In WordPress go to Settings → PubPulse, paste it and save.
  5. Open your site in a private window and check Real Time: your visit shows within seconds.

What the plugin does:

  • adds the script (about 1 KB, deferred) to every page, and asks WP Rocket, LiteSpeed Cache and Autoptimize to leave it alone;
  • sends author, category, article ID, title and publish date with every post view;
  • leaves out visits from logged-in authors, editors and administrators (can be turned off);
  • tracks AMP pages made by the official AMP plugin;
  • optionally sends an outbound_click event for links to other sites.

Developers can add dimensions with the pubpulse_dimensions filter and skip pages with pubpulse_should_track.

Without the plugin

  1. Install a header plugin such as WPCode or Ad Inserter (or use the header field of your theme).
  2. Paste the code from Settings → Tracking Code in the header section, for every page.
  3. Exclude the script from WP Rocket, LiteSpeed Cache or W3 Total Cache optimisation.

Send author, category and article data

In Settings → Tracking Code → Via WordPress Plugins you find a PHP snippet for Ad Inserter (PHP enabled) that sends these custom dimensions with every pageview:

DimensionValue
author_id, author_namethe post author (display name)
article_id, article_titlethe post ID and title
category_id, category_namethe first category
published_datethe publish date (YYYY-MM-DD)

Press Register these dimensions on the same page and they appear as tabs in the Content report and as filters everywhere.

AMP plugin

If you use the official AMP plugin, follow AMP pages for the amp-analytics block.

Try PubPulse free for 30 days

Every feature, no pageview limit, no credit card. Paste one line of code and your first visits show up within seconds.

Start your free trial

or click around the live demo first, no sign-up needed