Google Pub/Sub Push Subscription

Zoho Analytics allows you to stream messages published to a Google Cloud Pub/Sub topic through a push subscription. Zoho Analytics generates a unique Push URL for the stream table. You set this URL as the endpoint of a push subscription, and Pub/Sub delivers each message to Zoho Analytics as it is published.

Note: To read from a pull subscription instead, use Google Pub/Sub Pull Subscription.

1. Before You Begin

  • Availability: Available in the Premium plan and above. You can connect up to 5 streaming sources in Premium and up to 20 in Enterprise. To connect more, purchase add-ons.
  • A Google Cloud project with a Pub/Sub topic that receives your events.
  • Permission to create subscriptions in the project.
  • Messages published as JSON whose keys match the table column names exactly, including case.

Note: Use flat JSON. A nested object is stored in a single text column.

2. Creating the Stream Table

Follow the below steps to create the stream table:

  1. Click Import Your Data at the top right corner of the Home page.
  2. Select Streaming Data in the Category list, and click the Google Pub/Sub Push Subscription tile.
  3. If the Import Streaming Data into Zoho Analytics pane appears, click Proceed.
  4. Enter a Workspace Name, if you started from the Home page.
  5. Click Copy next to Post to copy the Push URL, and click Next.

[Image: Step 1 - Configure URL for Google Pub/Sub Push Subscription, showing the Workspace Name and the Push URL with the Copy button.]

Note: The Push URL contains a secret key. Use it only as the endpoint of your push subscription.

3. Configuring the Push Subscription

Follow the below steps in the Google Cloud Console:

  1. Go to Pub/Sub > Subscriptions and click Create subscription.
  2. Select the topic that receives your events.
  3. Set Delivery type to Push, and set Endpoint URL to the Push URL.
  4. Select Enable payload unwrapping, and create the subscription.

[Image: The Google Cloud Console subscription form with Delivery type set to Push, the Push URL as the Endpoint URL, and payload unwrapping enabled.]

Note: Payload unwrapping is required. Without it, Google wraps each message in its own fields, and the table columns do not match.

4. Designing the Table

In Step 2 - Design Table, choose how to define the columns.

OptionUse it whenWhat happens
Design table manuallyYou know the keys and data typesYou add each column yourself
Provide sample dataYou have a sample messageColumns and data types are filled from your JSON
Fetch data automatically from sourceYou can publish messages nowZoho Analytics listens on the Push URL for up to 120 seconds and fills the columns from the messages it receives

Design Table Manually

Use this option when you already know the structure of your messages.

  1. Select Design table manually and click Next.
  2. In the empty grid, click + Add New Column for each JSON key, and enter its Column Name and Data Type.

Provide Sample Data

Use this option to build the table from a sample message. Zoho Analytics reads the keys and infers the data type of each column.

  1. Select Provide sample data.
  2. Paste a JSON object or a JSON array of objects in the Provide sample JSON box.
  3. Click Next. The columns appear in Step 3 - Table Details, where you can review them.

Note: If the JSON is not valid, the message Invalid JSON appears.

Fetch Data Automatically from Source

Use this option when you can publish messages to the topic now. Zoho Analytics builds the table from live data.

  1. Make sure payload unwrapping is enabled on the push subscription.
  2. Select Fetch data automatically from source. The Push URL is shown.
  3. Publish one or more messages to the topic. Zoho Analytics listens for up to 120 seconds. To stop, click Cancel.
  4. When a message arrives, the columns are filled automatically.

Note: If payload unwrapping is off, the columns are filled from the Pub/Sub wrapper fields instead of your message fields. If no message arrives within 120 seconds, the message No data was received for validation appears.

Reviewing Table Details

In Step 3 - Table Details:

  1. Enter a unique Table Name.
  2. Review each column:
    • Column Name: Must match the JSON key exactly.
    • Data Type: How the value is stored.
    • Is Mandatory?: Messages missing this key are rejected.
    • Default Value: Used when the key is missing.
    • Is Personal Data?: The column is encrypted.
  3. To add a column, click + Add New Column below the grid.
  4. Click Next to create the table.

Note: Check the inferred number types. A Positive Number column rejects decimal values, so change it to Decimal Number if your values have decimals.

5. Validating and Importing Data

In Step 4 - Validate and Import Data:

  1. Optionally, set the retention period and turn on Enable Historical Data. See Retention and Historical Table.
  2. Click Validate & Import Streaming Data. Zoho Analytics listens for 120 seconds.
  3. Publish a matching message to the topic within this time.

When the message matches, the status changes to Consuming Streaming Data and the import starts. If validation fails, read the Failure Reason(s), fix the issue, and click Validate Again.

Note: If you close the wizard before validation succeeds, you can validate later from the Data Sources page.

6. Managing the Data Source

In the workspace, click Data Sources in the left navigation pane and select the Google Pub/Sub Push Subscription source. From here, you can:

  • View the Push API URL, Last Fetched Time, and Streaming Status of the table.
  • Validate, Pause, or Resume the stream using the action next to its status.
  • Click Regenerate Key next to the Push API URL to create a new Push URL. The old URL stops working immediately, so update the subscription's Endpoint URL.
  • Click the edit icon on the table row to change the retention period.
  • Click the error icon on the table row to read the last failure reason.

Note: This data source holds one table. To stream into another table, start a new import.

7. Retention and Historical Table

  • Retention: Rows stay in the stream table for 1 hour by default. To change this, set 30 minutes to 24 hours under Streaming Data Retention Period and click Save. Older rows are removed automatically.
  • Historical table: Turn on Enable Historical Data in Step 4, or the Historical Table toggle on the Data Sources page. Zoho Analytics creates {Stream table name} - Historical_Table, which keeps a copy of every incoming row.
  • Turning it off: The historical table and its data stay, but new rows are not added. To delete the historical table, turn it off first.

Note: Historical table rows count toward your workspace row limit.

8. Streaming Statuses

  • Yet to be validated: The table is created but not validated. Click Validate.
  • Validating: Zoho Analytics is listening for 120 seconds.
  • Consuming: Data is being imported. Click Pause to stop.
  • Paused: The import is paused. Click Resume to restart.
  • Validation Failed: No matching message arrived within 120 seconds. Click Validate.
  • Failed: The stream stopped after repeated messages could not be used. Fix the cause and click Resume.

9. Limits

  • A stream table holds up to 1 million rows or 1 hour of data.
  • This data source holds one table.
  • Stream tables cannot be copied.
  • Reports refresh about every 30 seconds. Dashboards must be refreshed manually.
  • You can connect up to 5 streaming sources in Premium and up to 20 in Enterprise. To connect more, purchase add-ons.

10. Frequently Asked Questions

Why is my table empty even though messages are published?

Payload unwrapping is usually off, so Zoho Analytics receives the Pub/Sub wrapper instead of your fields. Enable payload unwrapping on the subscription, then click Validate and publish a message.

Can I use a pull subscription with this service?

No. This service receives messages only through a push subscription. To read from a pull subscription, use Google Pub/Sub Pull Subscription.

Why did my stream move to Failed?

Many messages in a row could not be used. Their keys did not match, a mandatory key was missing, or values did not fit the column types. Fix the source and click Resume.

Does pausing a stream delete data?

No. Existing rows stay until the retention period removes them.

PREVIOUS

UP NEXT