How to receive journey form submissions into a Google spreadsheet with Zavvy webhooks

In this document, we will go through the process of setting up webhooks on Zavvy and a Google Spreadsheet to update the spreadsheet with data submitted in Forms on Zavvy.

Overview

The setup overview is as following:

  1. Create a Google Apps Script for a Spreadsheet that can receive HTTP POST requests and deploy it.
  2. Configure Webhook endpoint on Zavvy to send events to the Apps Script’s endpoint.

Prepare Google Spreadsheet to receive Webhooks

Create an Apps Script for the spreadsheet

  1. Create a new empty spreadsheet or open an existing spreadsheet.
  2. Go to extensions and click “Apps Script”
  3. Here, write your code to receive the Zavvy Webhook payload, transform the data as required and insert it into the spreadsheet.
  4. The documentation from Google is here.
  5. We created a sample script for you to get started with if you need help. https://github.com/zavvy-io/sample-zavvy-webhook-to-google-spreadsheet-appscript

NOTE: It is important that you don’t use Content Service to return any response to doPost. Otherwise, the webhook requests will fail to deliver efficiently. This is because of the redirects behaviour of Apps Script’s Content Service. Please always just return nothing in the doPost. See our sample scripts for example.

Deploy the Apps Script

  1. Once you finish editing your code, select “Deploy > New Deployment”.
  2. In type, select “Web app”.
  3. Under configuration:
  4. Give a description or leave it empty.
  5. “Execute as”: Select yourself.
  6. “Who has access”: Select “Anyone”.
    NOTE: This will make the endpoint public and anyone can post to this endpoint. Securing the endpoint is not covered in this guide. A quick solution could be set a secret key and make the Zavvy webhook set a header with the same secret key and accept requests only matching that key.
  7. Deploy
  8. Once deployed, you will receive a URL for the endpoint. Make a note of this.

Setup Zavvy Webhook to send data to Apps Script

  1. On Zavvy, navigate to People Data > Integrations > Webhooks.
  2. Click a “Add new Endpoint” with the URL you copied from the Apps Script deployment.
  3. Under Message Filtering, enable journey.form_submission.submitted events.
  4. Create!

Enable Webhooks on a Journey step

To receive webhooks, you need to also enable webhooks on a Form on the Journey step that you are interested in receiving the events for.

  1. Navigate to the Journey builder
  2. Find the Step and enable Webhooks on Form.

Testing with a sample Submission

  1. Assign the Journey to yourself and submit the step.
  2. In a minute or so, you will be able to see the data populate into your Spreadsheet

Debugging

If you don’t see the data in your spreadsheet, make sure:

  • Webhooks are enabled on the Form in the Journey step.
  • If you created a new deployment of Apps Script, the endpoint URL will change. Make sure the webhook is configured to the most recent deployment URL of your Apps Script.
  • make sure you have not hard-coded a sample webhook payload in the Apps Script for testing.

On the webhooks management portal on Zavvy, you can see a log of all the events that are triggered and the attempts to deliver those events to the endpoint configured. Take a look at the logs and see if you find anything that can help you debug the issue further.

If you need help, please reach out to us.