Přejít k obsahu  Přejít k hlavnímu menu

Blog / Knowledge base

Updated: 3. August 2020

Actions in Mailocator

Controlling Mailocator with Actions opens up a number of options for modeling your campaigns

What are Actions?

Actions are simple calls to Mailocator, in order to complete user interaction - typically closing or sending a window.
In addition, it is possible to chain actions, for example, to ensure that after successful submission of the form, the window closes itself in the selected number of seconds.

Actions can be written directly to the source code or by the user in the Designer.



How it starts?

Actions follow javascript events, usually onclick on buttons and images.
To process the form, the actions are associated with the onsubmit event.

When writing to the source code, you must add a call to the mailocator.action.do () action to the event and specify one or more actions in parentheses.

For example, to close a window, you can add an close action to an HTML element by typing:
onclick="mailocator.action.do('close')"


Add Action in Designer

Select an element
In the palette, select the symbol for Actions (Event)
Choose an action and confirm by clicking on the "Add action" button




Chaining Actions

Actions can be arbitrarily chained, a character is inserted between individual actions "pipe" |.

For example, the "submit form content and close pop-up after three seconds" action looks like this:
onclick="mailocator.action.do('subscribe|close:3')"



Overview of supported Actions

The list of supported Actions for individual objects (pop-ups, notifications, ...) may differ.

You can get a valid list, including the correct parameters, in Scenarios in the drop-down menu of a specific object, for example, the following list of actions is displayed for pop-ups:



Alphabetical overview of Events:


close closes the current object and this object will no longer be displayed

close:[int] closes the current object in seconds

closeID:[int] closes the object defined by the campaign identifier X (for example from an external script etc.)

closeCampaign:[string] closes the object defined by the trigger type (for example 'POPUP')

consent confirmation of consent to cookies (cookie consent)

destroySession deletes the user's session, including cookies (anonymization occurs)

disable turns off the Mailocator engine for the given user session

disableID:[int] switch off camapign identified by given ID

enable turns on the Mailocator engine for the given user session, if the engine was turned off by the action disable

expand expand the CTA or FEEDBACK object to its full size

feedback sending and saving the results of the feedback questionnaire

ga:[string] sends the specified event to Google Analytics

hide removes the object from the page, but the object can be displayed again (unlike close)

nexstep if a multi-step pop-up is created in Designer, it takes the user to the next step in a row

nexstep:[int] moves the user to the step defined by the sequence number displayed in the Designer (back or forward)

reset obnoví setting the session to its original state as if the user had taken no action and no conversion had taken place

setCampaign:[string] calls the campaign by name for use in other actions that are called from external scripts.
E.g. mailocator.action.do (setCampaign: popup | close) switches the campaign context to POPUP and closes the currently open pop-up.

subscribe submits the form for processing

subscribe:1 submits the form for processing and waits for the result

triggerID:[int] forces the campaign to run by number

url:[url] go to the specified URL

validate real validation of an email address, detection of typos etc.
Validation must be enabled in Mailocator Settings, otherwise each syntactically correct address is considered valid.





RELATED

Scenario in Mailocator

The Mailocator scenario is a key tool for setting up your campaigns to work properly. See everything and how easy it is to set up.

Discount codes

Mailocator allows you to pass discount and promotional codes to email campaigns

Discount codes obtained from the API in real time

In addition to code stacks, Mailocator allows you to read discount codes in real time from an external API, display them in a thank you page and pass them to an email tool.

Transfer of data from Mailocator to ESP

Sometimes it is useful to provide additional information from Mailocator, usually state, gender, favorite categories, discount code or name and surname. How to do it?

Preparation of the winning calendar (Advent calendar)

Mailocator contains pre-prepared templates for action calendars, which reveal to users the winnings for a specific day in exchange for an email address. You can easily prepare an Advent calendar with a discount or an event for each day.

Scratch card

A scratch card is a campaign in which the marketing content (discount, notification, coupon...) is covered by an image that can be wiped with the mouse cursor or a finger on the screen of the smart device. After deleting and revealing the content, you can automatically trigger an action, such as getting an email address.