Google Analytics

Analytics platform by Google

Go to site
Explore
/
Apps
/
Google Analytics

Google Analytics API Integrations

Build and run workflows using the Google Analytics API. Use 1000s of source-available triggers and actions across 1000+ apps. Or write custom code to integrate any app or API in seconds.

Overview

The Google Analytics API lets you access data from your Google Analytics account to build custom reports and dashboards. With the API, you can query data from your account, customize the data returned, and access data in real time.

Here are some examples of what you can build with the Google Analytics API:

  • A dashboard to track your website's traffic
  • A report to show which keywords are driving traffic to your website
  • A tool to track how users are interacting with your website
  • A report to show which browsers and devices are being used to access your website
  • A tool to track conversions and goal completions on your website
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { axios } from "@pipedream/platform"
export default defineComponent({
  props: {
    google_analytics: {
      type: "app",
      app: "google_analytics",
    }
  },
  async run({steps, $}) {
    return await axios($, {
      method: "post",
      url: `https://analyticsreporting.googleapis.com/v4/reports:batchGet`,
      headers: {
        Authorization: `Bearer ${this.google_analytics.$auth.oauth_access_token}`,
      },
    })
  },
})
Run Report with Google Analytics API on New Requests (Payload Only) from HTTP / Webhook API
HTTP / Webhook + Google Analytics
 
Try it
Send Message (Advanced) with Discord Webhook API on Page Opened from Google Analytics API
Google Analytics + Discord Webhook
 
Try it
Run Report with Google Analytics API on New Item in Feed from RSS API
RSS + Google Analytics
 
Try it
Run Report with Google Analytics API on New Submission from Typeform API
Typeform + Google Analytics
 
Try it
Run Report with Google Analytics API on Custom Events from Zoom API
Zoom + Google Analytics
 
Try it
Page Opened from the Google Analytics API

Emit new event when a page is viewed

 
Try it
Run Report with the Google Analytics API

Return report metrics based on a start and end date. See the docs here

 
Try it

Authentication

Google Analytics uses OAuth authentication. When you connect your Google Analytics account, Pipedream will open a popup window where you can sign into Google Analytics and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Google Analytics API.

Pipedream requests the following authorization scopes when you connect your account:

emailprofilehttps://www.googleapis.com/auth/analytics.readonly
OAuth Request Configurations:
  1. authorization
    GEThttps://accounts.google.com/o/oauth2/auth?client_id={{oauth.client_id}}&redirect_uri={{oauth.redirect_uri}}&state={{oauth.state}}&response_type=code&scope={{oauth.space_separated_scopes}}&prompt=consent&access_type=offline
  2. accessToken
    POSThttps://oauth2.googleapis.com/tokencontent-type: application/x-www-form-urlencodedaccept: application/json
    client_id={{oauth.client_id}}&client_secret={{oauth.client_secret}}&redirect_uri={{oauth.redirect_uri}}&grant_type=authorization_code&code={{oauth.code}}
  3. refreshToken
    POSThttps://oauth2.googleapis.com/tokencontent-type: application/x-www-form-urlencodedaccept: application/json
    client_id={{oauth.client_id}}&client_secret={{oauth.client_secret}}&grant_type=refresh_token&refresh_token={{oauth.refresh_token}}