Documentation / Product / Integrations / Google / Google Cloud Pub/Sub

Google Cloud Pub/Sub: Import Events

Importing user and activity data from Cloud Pub/Sub in real-time results in new users or existing user profiles supplemented with activity data. You can use this data to build and refine your existing Lytics audiences to power better, cross-channel campaigns.

The integration is similar to AWS Kinesis Streaming or Azure Event Hubs. It requires you to set up a Cloud Pub/Sub Topic, which you publish JSON messages to. Lytics then listens (subscribes) to this Topic and receives those messages.

Integration Details

This integration utilizes the Cloud Pub/Sub API methods of receiving events from a publisher. Specifically we use the Golang library. You are the publisher who sends (publishes) events through a user-created object known as a Topic. Lytics manages an object called a Subscription, which receives the data (events) from the Topic you created. The continuously running job works like this:

  1. Through the service account token you created in the authorization step, Lytics creates a new client, which manages and receives events using the subscription.
  2. Lytics verifies the Topic ID you provide in the job configuration, and creates a connection to the Subscription associated with this Topic. If no Subscription exists or is provided, Lytics creates a new Subscription in the following format: lytics\_subscription\_RANDOM_WORKFLOW_ID.
  3. The Topic is the "publisher", whereas the Subscription is the "receiver". This means you must publish/send data to this Topic from your account, which Lytics will then receive and process.
  4. The job will continue to get events in real-time as soon as events are published on the Topic.
  5. The events are sent to a user-selected stream which then gets added to user profiles or creates new user profiles.

Fields

Data imported by this job will be sent to a new or existing data stream in your account which you can define as part of the configuration. You will need to map the raw event data into user or content fields using LQL. You may reach out to Lytics Support for assistance with mapping your custom data.

Configuration

Follow these steps to set up and configure an import of events from Google Cloud Pub/Sub into Lytics.

  1. Navigate to Data > Jobs and click the Create New Job button. google-cloud-215
  2. Select Google Cloud.
  3. Select Import Data (CLoud Pub/Sub).
  4. Select the Cloud Pub/Sub service account authorization you would like to use.
  5. In the Stream text box, either select or type in the stream you would like to send these events to.
  6. Enter the Topic ID you would like Lytics to receive events from.
  7. (Optional) Enter an existing Subscription Name that you would like to receive events on or leave it blank and Lytics will create a new one named lytics_subscription_RANDOM_ID.
  8. By default, after 100 bad messages (usually because they are not JSON), the job will error. If you would like to change the maximum number of bad messages before the job errors, enter a number under Max Bad Messages. pubsub import config 1/29/21
  9. Click Start Import to begin importing data from your Pub/Sub topic.