Note: Please note: This method is for developers. If you're not well versed into how you can dynamically insert JavaScript code per session with known values, this method will not work for you. Consider checking out our guides on sending events to Emercury as a non-developer.

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.

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?