How To Setup Elevar's Google Pub/Sub Integration

📘

Note that the pub/sub connector is likely to be used only be technology partners, and clients with a data team that want raw access to our event stream. This connection is unlike any other in that it does not connect the merchant to a channel (like FB) it is a raw export of the event data that Elevar generates, similar to a BigQuery export from GA4, but without going through GA4

Overview

  • This connection works by sending event data from Elevar’s servers into a clients GCP project. In order to facilitate this connection we need the client to perform the following steps.

Prerequisites

  1. Install the Shopify Source on your store. Follow our guide on How to Install the Shopify Source
  2. If you don't already have a Google Cloud Project (GCP) that you'd like to use create a new one in the Google Cloud Platform by following this guide
  3. In your GCP project create a new topic by following this guide and give Elevar’s service account ([email protected]) publisher permissions to the topic. To do this add the IAM role roles/pubsub.publisher to the topic. Information on this can be found here
  4. Provide Elevar with your GCP project name and your topic name
  5. Wait for Elevar to notify you the connection has been enabled
  6. Handle events (Sample GIST)
    1. const {PubSub} = require('@google-cloud/pubsub');
      
      async function listenForMessages() {
        const pubsub = new PubSub();
        const subscriptionName = 'elevar-event-subscription';
      	const subscription = pubsub.subscription(subscriptionName);
      
        const messageHandler = (message) => {
          // Handle event 
          message.ack();
        };
      
        subscription.on('message', messageHandler);
      }
      
      listenForMessages();

Add the Pub/Sub Destination in your Elevar App

Navigate to My Tracking

Step 3 screenshot

Click on Add Destination

Step 4 screenshot

Find and Select Pub/Sub

Click on Get Started

Step 6 screenshot

Review Your Events

We recommend using our best practice, expand the Event Breakdown method to view and select "I want to customize events manually" if you want to make any adjustments on which event data to pass to Pub/Sub

Step 7 screenshot

If applicable, Enable Consent Mode

If consent is required, follow these steps to enable consent mode & select your consent categories

If consent is not required, select Save & Continue.

Step 8 screenshot

Block Transactions

This step allows you to control exactly what purchase events are sent to Rakuten. You can block orders based on Source Channel Name, Order Tag or Order Gateway.

The most common scenario where retailers may want to block or send orders is with offline orders. Learn how to block these orders in this guide

Not sure if you need to block orders? Look at what Sales Channels you have in Shopify!

Configure Subscription Settings

Do you sell subscription products? If you do, you can choose to send first-time orders only or first time + recurring orders to your marketing destination. Once you've configured select Save & Continue

Add in your Pub/Sub Details

Input your details here. [How to find your Google Project ID?] [How to find your Pub/Sub Topic ID?]

When you are ready Go Live by clicking the Go Live button!

Step 12 screenshot