Web API tile with Google APIs, such as Google Analytics

This article covers how to use the Web API tile to query data from Google APIs, such as Google Analytics, and display this data in SquaredUp DS. For more information see How to use the Web API tile.

Prerequisites

  • SquaredUp DS v4 or above.
  • A Google project account and account, such as Google Analytics.
  • If you use a proxy server you may need to configure the proxy to allow the Web API tile to communicate with the Google APIs. See How to configure SquaredUp DS to use a proxy

A Connect edition license (or above) is required for this feature. To upgrade please contact [email protected].

Creating a new provider for Google APIs in SquaredUp DS

Adding a particular Google API provider is a one-time configuration task, and once you have that Google API provider configured you can use it with multiple tiles.

See How to add a Google API provider.

Configuring the Web API tile

The walkthrough below takes you through configuring a simple scalar tile to show the number of pageviews using Google Analytics.

This walkthrough is specific to Google Analytics, but the same principle can be applied to any of the Google APIs.

Walkthrough: Configuring the Web API tile for Google Analytics

  1. Create a new dashboard and click on Integrations > Web API.
  2. Select Web API (Scalar). The Web API (Scalar) tile is designed to show a single value, such as the number of pageviews. Web API (Grid) is for showing a table of data.
  3. In the provider section select the provider that you created earlier, for example GoogleAnalytics
    Next you need to find the correct URL to put in the http modeURL box for Google Analytics:
  4. In a separate tab browse to the Google Analytics Query Explorer
  5. Select your Account, Property, and View.
  6. Under metrics, start typing pageviews and select Page Views (ga:pageviews)
  7. Click Run Query
  8. Copy the URL (minus the https://www.googleapis.com/) from the API Query URI section, so you have something like the following:
    /analytics/v4/data/ga?ids=ga%3A5###ACCOUNTID###&start-date=30daysAgo&end-date=yesterday&metrics=ga%3Apageviews
  9. Paste this URL into the http modeURL box on your SquaredUp DS dashboard.
  10. Leave the headers & data section as it is, and click on to the response data section.
  11. In the response data section, paste rows.0.0 into the key path box.
  12. In the scalar section, paste pageviews into the unit box.
  13. Click done

Was this article helpful?


Have more questions or facing an issue?