Google Sheets

Send your event data from RudderStack to Google Sheets.

Google Sheets is a popular spreadsheet program. You can seamlessly create spreadsheets that update and save automatically and are easy to access from your Google Drive.

Find the open source transformer code for this destination in the GitHub repository.

Getting started

RudderStack supports sending events to Google Sheets via the following connection modes:

Connection ModeWebMobileServer
Device mode---
Cloud modeSupportedSupportedSupported

Once you have confirmed that the source platform supports sending events to Google Sheets, follow these steps:

  1. From your RudderStack dashboard, add a source. Then, from the list of destinations, select Google Sheets.
  2. Assign a name to the destination and click Continue.

Service account permissions

To add Google Sheets as a destination in RudderStack, you must first obtain the Google Cloud service account credentials required for the configuration. Follow these steps:

  1. Go to your Google Cloud console. Under Quick access, click APIs & Services.
  2. In the left sidebar, click Credentials.
  3. Click + CREATE CREDENTIALS > Service account:
Google Sheets create credentials option
  1. Enter the service account details and click CREATE AND CONTINUE.
  2. Under Grant this service account access to project, select the Editor role:
Google Sheets editor role
  1. Click DONE to finish the service account configuration. The service account is now created.
  2. Under the KEYS tab, click ADD KEY > Create new key.
Google Sheets add key option
  1. Choose JSON as the key type and click CREATE.

The private key JSON will be downloaded and saved to your computer automatically. Use this JSON to set up your Google Sheets destination in RudderStack.

warning
Before setting up the destination in RudderStack, make sure you enable the Google Sheets API for your project.

Connection settings

To successfully configure Google Sheets as a destination, you will need to configure the following settings:

  • Credentials: Enter the contents of the credentials JSON obtained in the Service account permissions section above.
  • Sheet ID: Enter your Google Sheet ID present in the spreadsheet’s URL. For example, if the URL is https://docs.google.com/spreadsheets/d/aBC-123_xYz/edit#gid=920137070, then the sheet ID is 920137070.
  • Sheet Name: Enter the name of the spreadsheet to which you want to send the data. You can find the sheet name in the bottom left corner of the spreadsheet.
Google Sheets name
  • Map Event to Google Sheets: Use this setting to send an event property to a specific sheet’s column.
warning
  • For mapping the traits or event properties, enter the trait/property name directly, for example, firstName, email, etc. However, it is highly recommended to provide the absolute path to avoid ambiguity when you have the same attribute name in your event’s traits, context.traits, or properties object.
  • For mapping contextual fields or nested attributes, you must enter the absolute path to the attribute using dot notation. For example, context.app.build, address.zip, etc.
  • OneTrust Cookie Categories: Use this setting to associate OneTrust cookie consent groups to Google Sheets.

Identify

The identify call captures the relevant details about the visiting user.

A sample identify call is shown below:

rudderanalytics.identify("1hKOmRA4GRlm", {
  name: "Alex Keener",
  email: "alex@example.com"
  age: 25
})

Track

The track method lets you capture user events along with the properties associated with them.

A sample track event is shown below:

rudderanalytics.track("Product Purchased", {
  revenue: 4.99,
  currency: "USD",
  name: "Shirt",
  voucherCode: "FIRSTSALE",
  order_id: "OR19",
});

Page

The page call lets you record your website’s page views with any additional relevant information about the viewed page.

A sample page event is shown below:

rudderanalytics.page("Cart", "Cart Viewed", {
  path: "/cart",
  referrer: "test.com",
  search: "term",
  title: "test_item",
  url: "http://test.in",
})

Screen

The screen call lets you record whenever your user views their mobile screen, with any additional relevant information about the screen. This call is similar to the page call but is exclusive to your mobile device.

A sample screen event is shown below:

[[RSClient sharedInstance] screen:@"Sample Screen Name" properties:@{@"prop_key" : @"prop_value"}];

FAQ

Why aren’t the events sent to my Google Sheet?

To ensure that RudderStack sends your events to Google Sheets, verify if you have done the following:

  • Created a service account with Editor permissions for accessing and sending data to your Google Sheet.

  • Enabled the Google Sheets API for your project.

  • Set up the Google Sheets destination in RudderStack correctly:

    • Entered the credentials JSON.
    • Added the correct sheet ID and name.
    • Added the required property-column mappings in the dashboard settings.

Questions? Contact us by email or on Slack