"Publish Message" node

Google Could Pub/Sub is a messaging service for exchanging event data among applications and services. It lets you create systems of event producers and consumers, called publishers and subscribers. Publishers communicate with subscribers asynchronously by broadcasting events to a topic, without regard to how or when these events are to be processed. Pub/Sub then delivers events to all the subscribers of that topic, and each subscriber has its own logic of reacting to the event.

The integration between Synerise and this tool opens up possibilities of exporting data collected in Synerise. With the Publish Message node, you can push data from Synerise to Pub/Sub in the form of messages published to Pub/Sub queues in the CloudEvents standard. You can use this connection in various scenarios, such as exporting transactions, event data, customer information (such as marketing agreements), results of metrics, aggregates, expressions, reports, and many more to Google Cloud Pub/Sub. This lets you seamlessly integrate Synerise with third-party tools or other Google Tools such as Google Analytics, Google Ads, Google BigQuery, Google Sheets.

During the configuration of the node, you can use Jinjava inserts which let you dynamically refer to the profile attributes and event parameters in the workflow.

Important: This node is not optimized for batch operations that send large volumes of data (for example, updating all events for each profile). Use it to export changes within one event, profile attribute (for example, marketing agreement), analysis results, and so on.
Note: We recommend publishing data in Google Pub/Sub using the CloudEvents standard, however if you want to publish a message out of this standard or if you want to publish more than one message at once, proceed with “Publish Raw Message” node.

Prerequisites


Node configuration


  1. Click Google Cloud Pub/Sub > Publish Message.
  2. Click Select connection.
  3. From the dropdown list, select the connection.

Create a connection

To allow the data exchange, establish a connection between Synerise and Google Cloud Pub/Sub.

  1. At the bottom of the Select connection dropdown list, click Add connection.
  2. On the pop-up, click Sign in with Google.
  3. Select a Google account which has:
    • Access to the project and topic in Google Cloud Pub/Sub that you want to use.
    • Permissions to publish messages in that project and topic.
  4. Follow the instructions on the interface.
  5. After successful authentication, click Next.
  6. In the Connection name field, enter the name of the connection.
    It’s used to find the connection on the list.
  7. Click Apply.
    Result: A connection is created and selected.

Define the integration settings

In this step, fill in the form that allows you to publish a message in Google Cloud Pub/Sub in CloudEvents standard.

Note: You can use Jinjava inserts when defining any field of this integration, for example Data (optional) field or Attributes (optional) field to dynamically send data stored in Synerise. This way, Jinjava dynamically fills in values (for example, ID, email address, expression/aggregate result) for each profile/item.
  1. In the Project ID field, enter the unique identifier of your project in Google Cloud Console.
    You can learn how to find the project ID here.

  2. In the Topic ID field, enter the unique identifier of the topic (a named resource that represents a feed of messages). Learn more about creating and managing topics.

  3. In the Attributes (optional) field, enter a JSON key-value object with message attributes.
    This can be used to filter messages in the subscription. Learn more about building the “attributes” object. The Attributes object can contain up to 100 attributes.

    Click here to see example of Attributes object

    {
        "cardID": "XXX"
    }
        

  4. In the CloudEvent type field, enter the type of data sent in the CloudEvent.
    Learn more about CloudEvent types.

  5. In the Data (optional) field, enter the event data.
    It will be sent to Pub/Sub as the data object in a CloudEvent JSON Object. The CloudEvent object will be automatically encoded with base64 and sent as the data field in a Pub/Sub Message.

    Click here to see example of the Data field

    {
        "name": "John",
        "age": 30,
        "hasCard": true
    }
        

  6. Confirm the settings by clicking Apply.

Note:

When publishing the message in CloudEvents standard to Pub/Sub, Synerise ads the following parameters automatically to data object in the message body:

  • specversion with the value 1.0,
  • type with the value entered in CloudEvent type field,
  • time with the time of publishing the message,
  • source with the value /synerise/automation/{workflowID}, where {workflowID} part is replaced with the ID of the automation workflow,
  • id with the unique hash generated automatically,
  • datacontenttype with the value application/json; charset=utf-8,
  • subject with /synerise/automation/journeyId/{journeyID} value, where {journeyID} is replaced with the ID of the automation journey.

Example of use


Refer to this use case to see how you can use this node:

😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker