Templates / Marketing / Lead Intake via LinkedIn Lead Gen Form

Lead Intake via LinkedIn Lead Gen Form

Overview

This workflow template allows you to work with data recieved via your LinkedIn Lead Gen Forms:


It is triggered by an individual filling in and submitting a lead gen form and helps you extract and format the data for your Marketing and Sales teams to get the form data where it needs to be.

The main issue with Lead Gen Forms is that the data returned by them is in a complex nested format:

This workflow template converts the data associated with each response into a common, easily useable format which you can then use as desired.

It uses Google Sheets as a sample destination system, but this can be replaced with any of your chosen marketing systems (Marketo, Hubspot etc).

You could also modify this workflow to perform lead enrichment using tools like Zoominfo or Clearbit, and from there create/update/upsert a record in your marketing system.

End Result

The end result is that all form response data will be available in a final simplified Q+A list. You can then choose exactly what data you want to be stored in your destination service

The following screenshot shows collated data in the Tray.io output logs:

While the following shows lines of data that have been output to Google Sheets:

Prerequisites

This worklow assumes the following:

  • You have a LinkedIn lead gen form set up and ready for use
  • You have a destination service (i.e. a marketing tool such as Marketo or Hubspot) with any required custom fields configured to match the data being synced from your lead gen form

Getting Live

To configure the workflow for your own use:

  1. Create your own LinkedIn authentication for the Trigger. Apply this authentication to the trigger and also the http-client-1 connector.

  2. Add your urn:li:sponsoredAccount:xxxxxxxxx value to the LinkedIn trigger.

  3. If you want to use another destination service (the template defaults to Google Sheets), remove the Sheets connectors at the bottom and add the Marketing system steps as desired instead.

    You can use a similar find & upsert mechanism where you first search for the existing Lead and then determine whether to create or update.

    If you would like to use Google Sheets, or test with Sheets first, you will need to insert your spreadsheet ID to the Sheets connector steps.

  4. Set the lead gen form data you wish to be included in the destination service.

    This will be the data you pipe into the destination update / create / upsert operations from the Get formData object (strorage-3) connector. An example of this is included in the Sheets update and create operations.

    For Google Sheets you can specify the 'Row data' and the stored fields (first_name, company_name, email_address etc.):

    A Marketo example would look something like this:


For educational purposes the rest of this page will take you through how the workflow template is built to acheive the desired results.

This will help deepen your understanding of Tray.io and will give you the power to maintain and edit your workflow as necessary.

Workflow logic

The following screenshot illustrates the stages in the process of creating the list of Q+A responses.

It works in several stages.

The workflow is triggered by someone filling in a lead gen form:

Section 1 gets the adFormResponseId from the trigger and runs a LinkedIn API call to retrieve all of the details from the form response.

Section 2 loops through the main responses (name, company etc.) and adds them to the formData object.

Section 3 loops through the consent reponses (e.g. "would you like to subscribe to our newsletter?") and adds them to the formData object.

Section 4 loops through the hidden fields (e.g. 'accountname') and adds them to the formData object.

Section 5 adds the form id details and sets the final formData object

Section 6 gets the final formData object and chooses which fields to upload to Google Sheets, or the service of your choice

Implementation notes

Building the Q+A list (the formData Object)

A repeated method throughout this template is the following, whereby we:

  1. Get the list of Q+A responses (the formData object) in its current state using Data storage 'Get value'
  2. Create the next individual Q+A as a key/value pair and add to the formData object using Object Helpers 'Add key value pairs'
  3. Store the updated formData object using Data storage 'Set value':


Formatting keys

You will also notice that there are several Format Keys steps. These are necessary to change the Lead Gen form variables from dot notation to a simple string.

e.g. from com.linkedin.ads.TextOptionAnswer to comLinkedinAdsTextOptionAnswer

This is necessary so that they can be used as variables in subsequent builder steps without the '.' confusing the jsonpath notation used by Tray.io.

Please see the step-by-step explanation below for full instructions on how this is done

Step-by-step explanation


You will see that the steps below have both a step name (Format keys, Grab Answer Text etc.) and a programmatic name (loop-1 object-helpers-8 loop-3 boolean-condition-2 etc.)

The programmatic name is what enables the use of jsonpaths such as $.steps.object-helpers-8.result to pull data from previous steps in your workflow.

Please note that the numbering of these may appear to be out of sequence in your workflow. This is because your workflow may contain nested loops, multiple branches, booleans etc. which means that a strict top-to-bottom sequence of steps does not always occur.

Steps may also be moved or deleted after they have been created.


Section 1 - get form details

Section 2 - main responses loop

Section 4 - hidden fields

Section 5 - add extra data and set final list

Section 6 - get final list and choose form details to upload