The format that all custom events in Emercury follow is the following

emer("param", parametername, parametervalue); 

For async requests you would define it as such

emer("async-param", parametername, parametervalue);

After such an event fires off for the first time, Emercury will register this as an event type, and you will see it appear in the list of events in the events setup screen.

How do we utilize this for marketing automation?

Let's take an example and say that you have a quiz that people fill out, and you can trigger a "finished_quiz" event on the quiz completion page. There are 3 things you need to do

1) Create a "finished_quiz" event

Just put code like this in the page that loads on quiz completion:

emer("param", "finished_quiz", true);

2) Create an associated action

Go to the settings for the given domain under "Events & Settings", and click on the "Create Action" button.

  • Under "type" choose "Action"

  • Under "type of" choose the event, in this example "finished_quiz"

That's it! From now on, you can have automations that trigger off of a "Finished Onboarding Quiz" event.

*-Please note, the event needs to fire at least once before it appears as an option in the "create action" dialogue. Otherwise it won't appear in the "type of" dropdown menu.

3) Create an automation that triggers off of that action

What about events other than on-load?

Let's say that your pricing page has a switch where people can change between the annual option and the monthly option.

Suppose you want an event that's associated with people clicking on that switch? And consequently a marketing automation that triggers off of this switch?

In that case you would want to define an async custom event. For example something like this:

emer("async-param", clicked_pricing_switch, true);

And then you would want to fire than whenever someone clicks on the pricing switch. For example, you might do it like so:

(function ($){
$(document).ready(function () {
$('body').on('click', 'pricingswitch', function () {
emer("async-param", "clicked_pricing_switch", true);
});
});
})(jQuery);
Did this answer your question?