Collecting data from Webhook

Follow this guide to collect data using a webhook and preview the data.

Introduction

Use the Webhook connector to collect data from apps that allow you to use a webhook, such as Google Ad Lead Forms. The data collected by the Webhook datastream is passively received. This means you cannot collect the data manually. Instead, you select the events on which to collect data. For more information, see Advanced Webhook tips.

Prerequisites

Before you complete the procedure in this guide, perform all of the following actions:

  • Ensure you can log in to the app from which you want to collect data.

Connecting to Webhook

Adding a Webhook datastream

To add a Webhook datastream, follow these steps:

  1. Select the workspace you work with in Adverity and then, in the platform navigation menu, click Datastreams.

  2. In the top right corner, click + Create datastream.

  3. Search for and click Webhook.

  1. Click Next.

  1. (Optional) Rename your datastream.

  1. From Webhook URL, copy the URL.

  2. Log in to the app from which you want to collect data, and then paste the Webhook URL into the corresponding field. Adverity can receive data from any app that allows you to enter a webhook URL.

  3. In Provider, select the data source from which the data is collected.

  4. In Data extraction, define the data you want to include in the data extract.

    To include only a part of the JSON object received from the data source in the data extract, select the Define JSON Path option and specify the path to your data in JSON Path. If you enter a JSON path, only the data specified by the JSON path is included in the data extract, and all other data in the JSON object is ignored.

    For example, if the JSON object received from the data source is as follows:

    {
    	"name": "Test event",
    	"data": {
    		"id": 1,
    		"name": "John Doe",
    		"by": "John Doe",
    		"at": "2023-05-02T07:13:03.703Z"
    	},
    	"user": {
    		"email": "John@Doe.com"
    	},
    	"ts": 1683011583703
    }

    the following JSON Path $.data will create such data extract

    Example of data extract created based on $.data JSON Path for the JSON object above.

  5. (Optional) For the Google Ads Lead Form provider, in Key, enter the key to verify the data collection. You can find the key in the configuration of the app. If you cannot find the key, leave this field empty.

    The key adds additional security to the connector. If you add the key to both the app and the Key field in the configuration, Adverity can compare the keys to ensure the data is coming from the correct source.

    For more information see the Google documentation.

  6. For the Narvar provider, fill in the following fields:

    1. In Level, select the level on which you want to collect data.

    2. In Narvar key, enter your Narvar key to verify the data collection.

  1. Click Next.

Choosing where to load your data

To choose where to load your data, follow these steps:

  1. To assign destinations to your datastream, select their checkboxes. For more information on destinations and their configuration settings, see Introduction to loading data into Adverity Data Storage and external destinations.

  1. Click Next.

Collecting data from webhook

Data is passively received in the form of events. These events are stored in the Events section of that datastream. To collect data with the Webhook datastream, select the events on which to collect data. For more information, see Advanced Webhook tips.

Previewing data collected from Webhook

The fetch collects data from Webhook which takes some time. The Overview page of the newly created datastream is now displayed. To preview the collected data, follow these steps:

  1. In the All tasks tab, find the task at the top of the list, and click Show extracts.

  2. Click the top hyperlink.

  3. The data extract is displayed in a table containing the data that you have fetched.

What's next?

Advanced Webhook tips

Webhook events

The Webhook datastream passively receives data in the form of events. These events are stored in an events page. The Webhook events page displays the following information:

  • The ID of an event. This is displayed as a hyperlink. Click on the ID hyperlink to view more data of the event.

  • If an event has been fetched or not.

  • The time when the event was fetched.

Viewing Webhook events

To view Webhook events, follow these steps:

  1. Select the workspace you work with in Adverity and then, in the platform navigation menu, click Datastreams.

  2. Open the Webhook datastream by clicking on its name.

  3. In the top right corner of the page, click More .

  4. Click Events.

Collecting Webhook event data

To collect event data from Webhook, follow these steps:

  1. In the Events page, select the checkboxes of the events for which you want to collect data.

  2. Click Fetch selected events.

As a result, you are navigated back to the datastream overview page where you can view the progress of the data collection for the selected events.

The events can also be fetched automatically using the scheduling option. For more information, see Manual and scheduled fetches.

Viewing event details

To view the details of an event, follow these steps:

  1. In the Events page, find the event to view in more detail.

  2. Click on the number displayed as a hyperlink in the ID column.

As a result, you are navigated to a separate page that displays the following information:

  • Date displays the exact date on which that event was received.

  • Payload displays the content of the event in JSON format.