Google Cloud Functions is a Functions-as-a-Service (FaaS) product that lets you run your code in the cloud without any servers or containers.

RudderStack supports Google Cloud Functions as a destination where you can send your event data seamlessly.

Getting started

Before configuring Google Cloud Functions as a destination in RudderStack, verify if the source platform is supported by Google Cloud Functions by referring to the table below:

Connection ModeWebMobileServer
Device mode---
Cloud modeSupportedSupportedSupported
To know more about the difference between cloud mode and device mode in RudderStack, refer to the RudderStack Connection Modes guide.

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

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

Connection settings

To successfully configure Google Cloud Functions as a destination, you need to configure the following settings:

Google Cloud Functions connection settings
  • Choose your Trigger Type: From the dropdown, select HTTP or HTTPS depending on the trigger type configured for your cloud function.
You can set the trigger type while configuring your cloud function. For more information, refer to the FAQ section below.
  • Gcloud Authorization: If you have selected HTTPS as your trigger type, enter your Google Cloud Authorization Token.
  • URL: Enter the URL obtained in the Trigger field during the cloud function setup.
For more information on obtaining the URL, refer to the FAQ below.
  • API Key ID: Enter your API key ID. Refer to the Google Cloud documentation for more information on creating and using the API key.
The API key ID is a string required by the cloud function to identify a request. RudderStack injects this key in the ApiKey header in case of both the HTTP and HTTPS trigger types.
  • Enable Batch Input: Enable this setting to pass a batch input (array of events) to your cloud function.
  • Max Batch Size: If Enable Batch Input setting is enabled, specify the maximum batch size in this field.

Supported events

Google Cloud Functions accepts identify, track, page, group, and alias events.

This destination accepts raw event data similar to a webhook. RudderStack sends the entire event payload to Google Cloud Functions as is, without any transformation or modification.

FAQ

How do I create a Google Cloud Function?

To create a Google Cloud Function, follow these steps:

  1. Log into your Cloud Functions account and click VIEW CONSOLE.
  2. Select your project.
  3. Then, click CREATE FUNCTION.
  4. Enter a Function name and select the Region from the dropdown.
Verify that your cloud function name is valid.
  1. In the Trigger field, select HTTP or HTTPS, depending on your use-case.
  2. In the Runtime, build and connections settings, specify the memory allocated for the cloud function in the Memory allocated field.
  3. Configure the rest of the cloud function settings as per your requirement and click Next.
Google Cloud Functions setup
  1. Add the function code and the language in the Runtime field.
  2. Enter the function name as defined in your code in the Entry point field.
  3. Click Deploy to save your settings and create the Cloud Function.
  4. In the TRIGGER tab, copy the trigger URL - this is required to set up Google Cloud Functions as a destination in RudderStack.
Google Cloud Functions trigger URL

Contact us

For more information on the topics covered on this page, email us or start a conversation in our Slack community.

Contents