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

nextstep:[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.

setval:[input_name],[input_value] set value of input, make radio checked or checkbox checked setval:[checkbox_name]

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

Content replacement tags

There are several ways to copy arbitrary fields to campaign content, including influencing CSS class names, in Mailocator.

Action setval - change of values in Mailocator forms

The setval action can be used to dynamically change the default value in pop-ups

Connect and make forms for dialog-Mail

See how to easily connect dialog-Mail and build and setup subscription popup

Changes in the import of discount codes from 1 December 2020

If you use discount codes in Mailocator, please pay attention to the following information

Draw a random discount code

Do you need to draw a random win or a code to gamble popup? Mailocator allows you to easily set the probability to one hundredth of a percent, randomly select a win and deliver it to the email tool.

Launch a campaign using a URL

You can also invoke Mailocator campaigns or designs at any time using a parameter in your site´s URL