Skip to Content
DestinationsCloud StorageGoogle Cloud Functions

Google Cloud Functions

Send data to a Google Cloud Functions HTTP trigger. Use Zeotap to push audience lists, enriched profiles, model outputs, or event data to a serverless function for custom processing, transformation, or forwarding to downstream systems.

Prerequisites

  • A Google Cloud project with Cloud Functions enabled
  • A deployed Cloud Function with an HTTP trigger
  • One of the following authentication methods:
    • A service account with the Cloud Functions Invoker role (roles/cloudfunctions.invoker)
    • An OAuth 2.0 access token or Google identity token
    • An API key (if the function uses API Gateway or custom key validation)

Authentication

Zeotap supports three authentication methods for Google Cloud Functions.

Bearer Token

Use an OAuth 2.0 access token or a Google-signed identity token to authenticate requests.

  1. Generate an identity token using the gcloud CLI:
    gcloud auth print-identity-token
  2. In Zeotap, select Bearer Token as the authentication method
  3. Paste the token into the Access Token field

Identity tokens expire after 1 hour. For production use, consider using a service account instead.

Service Account

Use a GCP service account JSON key to authenticate. Zeotap generates identity tokens automatically from the key.

  1. In the Google Cloud Console, go to IAM & Admin > Service Accounts
  2. Create a service account (or use an existing one)
  3. Grant the Cloud Functions Invoker role (roles/cloudfunctions.invoker) on the target function
  4. Create a JSON key for the service account
  5. In Zeotap, select Service Account as the authentication method
  6. Upload or paste the JSON key

API Key

Use an API key if your function validates keys via API Gateway or custom logic.

  1. In the Google Cloud Console, go to APIs & Services > Credentials
  2. Create an API key (or use an existing one)
  3. In Zeotap, select API Key as the authentication method
  4. Paste the key into the API Key field

Configuration

FieldTypeRequiredDescription
Function URLTextYesThe HTTPS trigger URL for your Cloud Function (e.g., https://us-central1-my-project.cloudfunctions.net/my-function)
HTTP MethodSelectNoThe HTTP method to use: POST (default), PUT, or PATCH

Supported Operations

Sync Modes

ModeSupported
InsertYes
UpsertYes
Update
Mirror

Audience Sync Modes

ModeSupported
AddYes
RemoveYes
MirrorYes
UpsertYes

Features

  • Field Mapping: Yes — map source fields to custom payload keys
  • Schema Introspection: No — Cloud Functions accept arbitrary JSON payloads

How It Works

Zeotap sends data to your Cloud Function as JSON HTTP requests:

  1. Rows are collected into batches of up to 500 rows per request
  2. Each request includes a JSON payload with the sync mode, row data, operation type, and primary key
  3. The function receives the payload and can process it however you need — store data, forward to another API, trigger workflows, etc.
  4. Zeotap retries failed requests (429 and 5xx responses) with exponential backoff up to 3 times

Payload Format

Each HTTP request sends a JSON body with the following structure:

{ "sync_mode": "upsert", "rows": [ { "data": { "email": "user@example.com", "name": "Jane Doe", "segment": "high_value" }, "operation": "added", "primary_key": "user@example.com" } ] }

Headers

Every request includes these headers:

HeaderDescription
Content-Typeapplication/json
X-Sync-ModeThe sync mode (insert, upsert, add, remove, mirror)
X-Batch-SizeNumber of rows in this request
AuthorizationBearer token (if using bearer token or service account auth)
X-Api-KeyAPI key (if using API key auth)

Rate Limits

Google Cloud Functions enforce concurrency and request limits depending on your function configuration and Google Cloud quotas:

  • Max concurrent executions: 3,000 per region (default, can be increased)
  • Max request size: 32 MB for HTTP-triggered functions
  • Max response timeout: 9 minutes (1st gen) or 60 minutes (2nd gen)
  • Invocation rate: No hard limit, but bursts above 1,000 concurrent may queue

Zeotap sends batches of up to 500 rows sequentially. For high-volume syncs, ensure your function can handle the expected throughput.

Best Practices

  • Use 2nd gen functions for better concurrency, longer timeouts, and Cloud Run integration
  • Return proper HTTP status codes from your function: 200 for success, 4xx for client errors, 5xx for retriable server errors
  • Implement idempotency in your function logic — Zeotap may retry requests on transient failures
  • Use service account auth for production workloads instead of short-lived bearer tokens
  • Monitor function logs in Cloud Logging to debug payload processing issues
  • Set appropriate memory and timeout for your function based on the processing required per batch

Troubleshooting

Authentication failed (HTTP 401 or 403)

Verify that the service account has the Cloud Functions Invoker role (roles/cloudfunctions.invoker) on the specific function. If using a bearer token, ensure it has not expired.

Function URL not reachable

Check that the function is deployed and the trigger URL is correct. The URL must start with https://. Verify the function is not restricted by VPC Service Controls or ingress settings that block external access.

Request timeout

Cloud Functions have a maximum timeout of 9 minutes (1st gen) or 60 minutes (2nd gen). If processing takes longer, consider breaking your logic into smaller steps or using Cloud Tasks for async processing.

Payload too large

Zeotap chunks batches at 500 rows, but if individual rows contain large data (e.g., long text fields), the request body may exceed the 32 MB limit. Reduce the number of mapped fields or filter out large columns.

Function returns 500 errors

Check the function logs in Cloud Logging for stack traces or error messages. Common causes include unhandled exceptions in the function code, downstream service failures, or insufficient memory allocation.

Rate limiting (HTTP 429)

If you see 429 responses, your function is hitting concurrency limits. Increase the max instances setting on your function or reduce sync frequency. Zeotap retries 429 responses with exponential backoff automatically.

Last updated on