Synchronize user data using automation

Modified on Fri, 12 Nov, 2021 at 5:24 AM

This Brainstorm Automation Action should be used to push Contact Data from Brainstorm Automation to an API listener page on your server. You can in turn insert this data into your database or to your CRM, given it has its own api.

This listener is a web page or web application you create on your server that is always active and has code that allows it to accept and verify “contact” data sent from Brainstorm Automation, This listener then invokes backend services on your server, based on the information received.

The action to be taken when your listener is notified of an event is application-specific. Brainstorm Automation sends messages to the API listener using the URL you specify in your email automation step actions.

Brainstorm Automation uses “HTTP POST” to send information to your listener to notify it of a new event. Thus, your listener should listen for the HTTP POST messages that Brainstorm Automation sends with each event.

How it works

  1. Create a private file on your server that is not publically accessible to front-end users. The custom listener code will be added to this file (more explanation below).
  2. On the Brainstorm Automation automation action, choose Synch Contact to Third Party, choose which marketing data to synchronize and insert the path to the file created in step 1.
  3. Brainstorm Automationwill automatically send the marketing data to you each time a contact matches the automation rules specified.
  4. Brainstorm Automation sends a FORM POST containing contact information appended to the URL.
  5. The API listener (code sample included below) detects and processes the data.
  6. The API listener page must contain a custom script that waits for the messages, and then passes them to various backend applications for processing.

List of available marketing data

There are two ways to sync the data from Brainstorm Automation to the third party app.

  1. Using GET as in this example: https://www.example.com/?param1=[#SHORTCODE-1#]&param2=[#SHORTCODE_2#]&… where [#…#] are the custom fields shortcodes from the list you are targeting within the journey. These shortcodes will hold the values of the contact that reached that action, within the journey. The URL would be your receiving end of the API. Note you can use our shortcode library to manipulate the shortcodes, ex: [#PROPER EMAIL/2#] and there are no limits on the number of fields you can pass.
  2. Using POST request in the following order:
    Array
    (
        [transactionid] => 123456789
        [contact] => Array()
        [fields] => Array()
        [campaigns-opened] => Array()
        [links-clicked] => Array()
        [pages-visited] => Array()
        [automation-triggered] => Array()
        [goals-reached] => Array()
        [webhooks-triggered] => Array()
        [lead-score] => Array()
        [lead-status] => Array()
    )

Basic Information: ‘contact’

This field contains basic contact information such id, email address and phone number as Array:

Array
(
    [id] => Contact's ID
    [email] => Contact's E-mail Address
    [phone] => Contact's Phone
    [profile_url] => Contact's Profile Page
)

Custom Fields: ‘fields’

This field contains an array list of arrays of the custom fields for the contact:

Array
(
    [id] => Field ID
    [name] => Field name
    [value] => Contact's field value
)

Email Campaigns Open: ‘campaigns-opened’

This field contains an array list of arrays of the campaigns opened by the contact:

Array
(
    [id] => Campaign ID
    [name] => Campaign name
    [open_date] => Contact's open campaign date/time
)

Links Clicked: ‘links-clicked’

This field contains an array list of arrays of the links clicked by the contact:

Array
(
    [url] => Link url
    [clicks] => Contact's total clicks
)

Pages Visited: ‘pages-visited’

This field contains an array list of arrays of the pages visited by the contact:

Array
(
    [page] => Page url
    [visit_date] => Contact's page visit date/time
)

Automation Triggered: ‘automation-triggered’

This field contains an array list of arrays of the automation workflows triggered by the contact:

Array
(
    [id] => Automation ID
    [name] => Automation name
    [trigger_date] => Contact's automation triggered date/time
)

Goals Reached: ‘goals-reached’

This field contains an array list of arrays of the goals reached by the contact:

Array
(
    [id] => Goal ID
    [name] => Goal name
    [reach_date] => Contact's goal reached date/time
)

Webhooks Triggered: ‘webhooks-triggered’

This field contains an array list of arrays of the webhooks triggered by the contact:

Array
(
    [id] => Webhook ID
    [name] => Webhook name
    [trigger_date] => Contact's webhook triggered date/time
)

Lead Score: ‘lead-score’

This field contains an array list of arrays of the lead scoring reached by the contact:

Array
(
    [id] => Score ID
    [name] => Score name
    [score] => Score value
    [score_date] => Contact's score triggered date/time
)

Lead Status: ‘lead-status’

This field contains an array list of arrays of the lead status reached by the contact:

Array
(
    [score] => Contact's total score
    [label] => Contact's score label
)

 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article