helsingborg-stad/google-analythics

Plugin to integrate Google Analytics and display simple statistics.

Maintainers

Package info

github.com/helsingborg-stad/google-analythics

Type:wordpress-plugin

pkg:composer/helsingborg-stad/google-analythics

Statistics

Installs: 928

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 11


README

Plugin to integrate Google Analytics tracking and display statistics on the admin dashboard. It requires a Google Service Account with read permissions connected to the desired Google Analytics web property.

Getting started

Install libraries

This plugin requires Google APIs Client Library for PHP and is installed with Composer:

composer install

Google Service Account setup

  • Create a Project in the Google APIs Console
  • Enable the Analytics API under APIs & services
  • Create a Service Account for the project with view cababilities
  • Download the private key (JSON)
  • Finally add Service account ID as a new user to your Google Analytics account.

Filters

GoogleAnalytics/TrackingId/ua

Filters the Google Analytics UA (user id) used to load Google Analytics.

  • @param string $ua - The Google Analytics UA
apply_filters('GoogleAnalytics/TrackingId/ua', $ua);