Newspack’s Analytics let you enhance the default Google Analytics configuration.


Getting started

If you haven’t already, first navigate to Dashboard > Newspack > Analytics, and install and activate the Site Kit plugin. You will need a Google account in order to set it up.


Custom Dimensions

Dimensions are layers of data added to any pageview or event sent to Google Analytics. By default, GA sends dimensions such as location or language of the visitor.

On a news site, some additional custom dimensions can come in handy. Newspack supports reporting of four pieces of data related to a read article: category, author’s name, word count, and publish date.

Reporting of these has to be set up manually in the Analytics wizard of the Newspack plugin. Your GA account might already have some custom dimensions assigned, but otherwise the table should be initially empty. Create four custom dimensions (all with “Scope” set to “Hit”) and assign a role to each using the select in the table. In the end, the configuration should look like this:

You can browse the pageview data along custom dimensions in the Behavior > Site Content > All Pages view of the Google Analytics dashboard. Click on the “Secondary dimension” dropdown and choose one of the additional dimensions:


Custom Events

If you’re familiar with Google Tag Manager, you can think of Newspack’s Custom Events feature as a lightweight version of it. The most common case for custom events is reporting CTA clicks in order to measure conversion rates.

An example

Let’s set up tracking conversion rates for the “Donate” button in one of our demo sites:

By using Chrome browser’s developer tools, I can see that the “Donate” button is wrapped in a li element of id menu-item-92.

With this information in hand, I can proceed to the Analytics wizard in the Newspack plugin:

After saving the custom event, it should now be reported to Google Analytics. You can browse the reported data in Behavior > Events > Overview section of the Google Analytics Dashboard (analytics.google.com):

Tips

If not all of the pages are served as AMP pages, ensure that both “Selector” and “AMP Selector” fields for an event are present. The event target markup may differ between AMP and non-AMP pages, so be sure to check both.