Follow

Use Zapier to Connect Facebook Lead Ad Forms with Lasso

Use Zapier to Connect Facebook Lead Ad Forms with Lasso

IMPORTANT: The following need to be in place PRIOR  to integration with Lasso:

  • Create the Facebook Lead Ad Form
  • Set up a Zapier account (you'll need to sign-up for a fee-based service - i.e. not free)
  • Connect the Facebook Lead Ad Form to Zapier 

Lasso Support and/or your Client Director can assist you with the integration once the above is complete.

For help on planning and creating Lead Ads, please have a look at the Lasso blog 6 Steps to Creating a Facebook Lead Ads Campaign.

Here are some other links that contain more information:

1 – Make sure you have your Lasso UID, Project ID, and Client ID. You will find these in the Project Admin Center under View Registration Page Code.

2 – In Zapier, under Action, select Code by Zapier.

3 – Under Choose an Action App, select Code.

4 – Select Run Python.

5 – Click Continue.

6 – Select Edit Template.

7 – Under Set up Code by Zapier Run Python, enter your Lasso UID, Project ID, and Client ID (noted in Step 1) , and other data variables.

Note: The data variables filled in below are examples only. You will find the LassoUID, projectID, and clientID for your project in the Project Admin Center under View Page Registration Code.

Alternatively, you can complete the data variables from preset facebook data variables. This requires the facebook developer tool.

Note: You will need to fill in your LassoUID, projectID, and clientID as these variables are always hardcoded.

7 – Copy and paste the code below (registrant-submitter-py.txt) into the Code section as shown.

8 – Remove any variables you are not using. For example, if you are not including a Follow-up Process, remove 'followUpProcess': 'follow-up process',.

import requests

clientId = input_data['clientID']
projectId = input_data['projectID']
# alternatively, if clientId and projectId are not passed in as input, they can be hardcoded like this:
# clientId = '123'
# projectId = '456'

url = 'https://api.lassocrm.com/registrants'

headers = {'X-Lasso-Auth': 'Token=' + input_data['LassoUID'] + ', Version=1.0'}
# alternatively, if the auth token is not passed in as input, it can be hardcoded like this:
# headers = {'X-Lasso-Auth': 'Token=fgxb2rq, Version=1.0'}

json = {
      'firstName': input_data['firstName'],
      'lastName': input_data['lastName'],
      'clientId': clientId,
      'projectIds': [projectId],
      'emails': [
            {
                  'email': input_data['email'],
                  'type': input_data['emailType'],
                  'primary': True
            }
      ],
      'phones': [
            {
                  'phone': input_data['phone'],
                  'type': input_data['phoneType'],
                  'primary': True
            }
      ],
      'addresses': [
            {
                  'address': input_data['address'],
                  'city': input_data['city'],
                  'country': input_data['country'],
                  'province': input_data['province'],
                  'postalCode': input_data['postalCode'],
                  'type': input_data['addressType'],
                  'primary': True
            }
      ],
      'notes': [
            input_data['note']
      ],
      'questions': [
            {
                  'path': 'Marketing',
                  'name': 'What magazines/newspapers do you like to read?',
                 'answers': [
                       {
                              'text': 'Lasso Daily'
                        }
                 ]
           },
           {
                  'id': '34120',
                  'answers': [
                       {
                              'id': '160302'
                        },
                        {
                              'id': '160303'
                        }
                 ]
            }
      ],

'nameTitle': input_data['nameTitle'],

'company': input_data['company'],

'rating': 'N',

'sourceType': 'Online Registration',

'secondarySourceType': 'Facebook',

'followUpProcess': '30-day follow up',

'contactPreference': 'Any',

'sendSalesRepAssignmentNotification': True,

'thankYouEmailTemplateId': '155'

}

r = requests.post(url, json=json, headers=headers)

output = [{'status': r.status_code, 'reason': r.reason}]


 

The following data variables are supported:

  • First and Last Names
  • Email
  • Phone
  • Note/Comments
  • Rating
  • Source Type (Online Registration)
  • Secondary Source Type (Facebook)
  • Contact Preference - use only the following:
    • Any
    • Email
    • Mail
    • No Contact
    • No Email
    • Phone
    • Text
  • Follow-up Process
  • Send Sales Rep Notifications (True/False)

Note: Boolean values (True/False) are case sensitive. The 'T' and 'F' are capitalized.