After creating the project you will need to create a Service Account which will be able to access Google Analytics and enable the Google Analytics API.

Service Account

In the left sidebar, you should see Credentials link, click it the go to Create Credentials and then Service Account Key. In the form select “Compute Engine default service account” and JSON. Creating the account should automatically download a JSON file to your computer (we will use it later). One last thing we will need here is service account email

One last thing we will need here is service account email, go to the Credentials panel and click “Manage Service Account” (or something similar) you should see there your service account email, it will look similar to this 000000000000-compute@developer.gserviceaccount.com, copy it somewhere safe.

Enable Analytics API

While on the main screen of your Google API project, click Library in the left sidebar, search for Analytics API and enable it.

Add Service Account to Google Analytics

With the email address, you copied earlier, go to your Google Analytics account, click Admin / User Management and add your service account email to the users list, now we are ready to configure the Google Analytics for WPAdverts.

Plugin Configuration

Application Name – you can enter here any name you wish, it will only be used to help identify your application.

Service Email – the email address you copied earlier

Key – the key is in the file that was downloaded to your computer when you created a Google API Project, find it on your computer and open in a text editor like Notepad (do not use MS Word), copy the whole content and paste it into the Key field.

After filling the form click “Save” button, if the information was entered correctly you should see a form like on the below image.

WPAdverts Google Analytics configuration, step #2

Now you just need to select a service, that is a website which data you wish to use, or in other words a website on which this plugin is installed, so if you have the WPAdverts Google Analytics integration installed on https://demo.wpadverts.com/ then select this site and save the form again.

Using The Google Analytics Integration

The Google Analytics should now be available for Administrator in wp-admin / Classifieds panel while editing an Ad as a sidebar widget and a chart with a customizable date range (you can see it after clicking on the “View Chart …” button.

Quick stats in Classified Edition

It will also be available to users in the frontend when viewing single Ad details page and a more detailed stats similar to the one in wp-admin panel will be available in the [adverts_manage] panel.

Chart in [adverts_manage]

NOTE the stats on Ad details pages are being cached once an hour to avoid going over the Google Analytics API limits (which is 5000 API calls per day for free accounts).