Extending Marketing Automation Trigger & Action Definitions

How does it work

Marketing automation is a rules and filters system that listens for Triggers and performs Actions.

Trigger events are powered by WordPress action hooks, so the potential triggers we can listen for are endless.

Triggers

 

Example Triggers

Marketing Automation comes installed with these trigger listeners.

  • When a new lead is added to the lead database (hook name is inbound_store_lead_post)

  • When a page view is stored for a visitor into the Inbound Now inbound_page_views table (hook name is wplead_page_view)

  • When a tag/category/term is added to an post/page/custom-post-type object (this hook is called set_object_terms)

  • When a user registers (this hook is called user_register)

 

Trigger Filters

When action hooks fire inside of WordPress they usually cary data with them related to the event. If appropriate, users can create rule filters based on the data to determine if the following action events should fire.

For example when a new lead is created the action hook inbound_store_lead_post will fire, our rule will trigger, and we can look inside the event data to see if it came from a certain Inbound Form or not. If it did then we can run the actions. If it didn’t we’ll just ignore the event.

When setting up trigger filters we can tell our listener to match all filters, any filters, or none of the filters. These options will provide a lot of flexibility for performing complex rules.

Actions

 

Example Actions

Just like with triggers Marketing Automation comes with a handfull of installed actions that can be performed if a given trigger is selected. When a trigger is programmed it includes a list of actions is supports. We’ll go into this more later in this document. Included Actions:

  •  Add remove lead from a list (good for user creation and lead creation events).

  • Create a lead (good for user creation events)

  • Send email (leverages our email component)

  • Wait event (will pause rule for a certain amount of time)

  • Relay data event (will send data to external location using POST, GET, PUT, etc) (This is great for Zapier connections)

Action Filters

Action filters are different from trigger filters. Trigger filters carry data from an event. Action filters look up data directly from the database. This allows for validation lookups. These filters are programmable and are defined when creating trigger definitions.

For example, a lead is created on day 1 and a rule is fired. This rule says to wait 30 days and then check if the lead has viewed more than 100 pages. If they didn’t then send them an email containing a coupon, if they did then the rule completes without sending an email. This is not a rule I would personally setup on our website, but it does show how the Action filters would work.

Currently included action filters:

  • lead data (select measurable insights related to a Inbound lead)
  • user data (select measurable insights related to a WordPress user)

Creating new Triggers

This information will attempt to show how you can create your own trigger definition.

First we’ll start our by looking at our trigger definition that listeners for when a new user is created. Please read the comments to get a feel for what we are doing. You can create new trigger listeners from the format below:

 

Creating new Actions

More to come soon. This document is a work in progress.

Creating new Action Filters

More to come soon. This document is a work in progress.