Popular content based on Google Analytics
This module can be easily installed by adding 10up/googleanalytictrends
to your composer.json
file. Then, either autoload your Composer dependencies or manually include()
the GoogleAnalyticTrends.php
bootstrap file.
Additionally, you must define the following contestants:
GAT_CLIENT_ID
Client ID provided by Google APIGAT_SERVICE_ACCOUNT_NAME
Service account name provided by Google APIGAT_KEY_PATH
Path to the privatekey.p12 provided by Google APIGAT_VIEW_ID
View ID from from view setting section of Google Analytics dashboard
- Go to https://console.developers.google.com and create a new project
- Click APIs & Auth on the left rail then click the API submenu item
- Turn on the Analytics API
- Click the Credentials button on the left rail
- Create a new Client ID
- From the Create Client ID modal select Service account
- You will be prompted to download a .p12 file that you need to add anywhere in your WordPress install
- On the final screen you will see the Client ID and Email that is needed for setting up this module
- Take the Email that was generated and add it as a user to the Google Analytics Profile you will be accessing. See how to add a users here https://support.google.com/analytics/answer/1009702?hl=en