Embed API

Overview

The Google Analytics Embed API is a JavaScript library that allows you to easily create and embed a dashboard on a third-party website in a matter of minutes. It gives you a set of pluggable components that can work together to build complex tools, making it both simple and powerful at the same time.

A dashboard built with the Embed API.

Demos

The demos on this site showcase many of the things that are possible with the Embed API. Each demo builds on top of ideas presented in the previous one, so you should check them out in order.

  1. 1. Basic Dashboard

    This demos shows how to create a basic dashboard with a single timeline chart showing site traffic over the past week. You can update the chart to see data for any Google Analytics view you have access to.

  2. 2. Multiple Views

    Displaying two different views side-by-side is not currently possible through the Google Analytics website. This demo shows how easy it is to do this using the Embed API.

  3. 3. Interactive Charts

    This demo shows how you can build a dashboard that allows you to interactively explore your data. In this example you have a list of filters in one chart that you can click on and then a second chart will render showing just that filtered dataset.

  4. 4. Working with Custom Components

    The built-in components that ship with the Embed API are very nice, but sometimes you need to do more. This example shows how you can extend the Embed API to use your own custom components.

  5. 5. Third Party Visualizations

    The Embed API make it easy to query data and display it in a Google Chart. But it also allows you to access the raw data so you can display it however you want. This example uses the Chart.js visualization library.

  6. 6. Server-side Authorization

    This demo shows how you can use server-side authorization to display your Google Analytics data to users without granting them access to your Google Analytics account.

Code samples are included to help you get started, but feel free to view the page source or check out the code on Github.