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

isConverted mark campaign as succesfully converted

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

Instructions for your own design for the wheel of fortune

How to create a wheel of fortune with your own HTML and CSS code

How to Thank you page in Mailocator?

See how to better bring your future customers back to your site as you complete the verification process.

Wheel of Fortune

A popular gamification element is the wheel of fortune, in which the user is offered a reward for providing data or subscribing to newsletters.

Mark campaign conversions with actions

Where a campaign is not automatically marked as converted (such as a newsletter sign-up), you can add a conversion using an action to better evaluate the success of the campaign.

Scenario testing laboratory

An easy way to verify the functionality of the scenario in Mailocator is to run a laboratory where you can see the entire course of processing over time, including the evaluation of conditions and user actions.

Disabling and enabling Mailocator using a parameter in the URL

If you need to limit campaigns in time and the UTM parameter is not available, you can use the internal parameter of Mailocator