Update time: July 24, 2023
In this session, I will explain the EVENTS and CONDITIONS in the Rule. EVENTS and CONDITIONS (if) Events with any conditions are the If portion of a rule.
- Events——Specify one or more events that must take place to trigger the rule. Multiple events are joined by an OR. Any of the specified events will trigger the rule.
- Conditions——Narrow the event by configuring any conditions that must be true for an event to trigger the rule. An exception is defined as a NOT condition. Multiple conditions are joined by an AND.
Event Types
Event Types are based on Extension, and different Extensions have different Event Types. The following describes the Event Types in Core Extension.
Browser Events
Browser Events has two, Tab Blur and Tab Focus
- Tab Blur:Trigger the action when a tab loses the focus. Fired when the user clicks on a browser tab to jump to another page, When the page I am on is https://www.bbccss.com, then I clicked the second page to jump to https://www.bbccss.com/contact-me:
- Tab Focus:Trigger the action when a tab gains the focus. Click or open the current page, or follow the example above. For the second page, it is Tab Focus.
There are no settings for this event type.
Form Events
- Blur:Trigger the action when a form loses the focus. Mouse away from form, click elsewhere,Positioning via CSS)
- Change:Enter information after clicking on the form, We enter the information and this is the change:
- Focus:Trigger the action when a form gains the focus. Clicking on a form is Focus. After clicking, the cursor is here.
- Submit:Trigger the action when a form is submitted. Confirm that the form is successfully submitted. Note that this means successful. Only successful ones will be tracked. Unsuccessful will not be triggered.
Keyboard Events
Key Press:Trigger the event if a key is pressed. Monitor the operation of keyboard keys.
It is still positioned by CSS. In fact, The position of each key corresponds to the keycode, you can check it through https://keycode.info/, but it seems that it is not recommended in Launch.
Media Events
- Media Ended:Trigger the event when the media ends. Play ends.
- Media Loaded Data:Trigger the event when the media loads data.
- Media Pause:Trigger the event when the media is paused.
- Media Play:Trigger the even when the media is played.
- Media StalledTrigger the event if the media stalls.
- Media Time Played:Trigger the event if the media is played for a specified length of time. Play duration or playback ratio
- Media Volume Changed:Trigger the event if the volume is raised or lowered.
Mobile Events
- Orientation Change:Trigger the event if the device’s orientation changes.
- Zoom Change:Trigger the event if the user zooms in or out.
Mouse Events
- Click:Trigger the event if the specified element is clicked,contains touchpad and mouse clicks. This is the most used, For details, please refer to: 19 Click Tracking Implementation
-
Hover:Trigger the event if the user hovers over a specified element. configure whether the rule is triggered immediately or after a specified number of milliseconds.
- Mousedown:Just a mouse click, our most common operation.
Other Events
- Custom Code: you can use js to process some data will return the results you want
- Custom Event:Trigger the event if a custom event type occurs.
<span style="font-size: 12pt;">var addToCart = new CustomEvent('addToCart', 'detail': {'product_id': data.product.sku, 'quantity': data.product.quantity, 'price': data.product.price.fullPrice}); document.getElementById('minicart').dispatchEvent(addToCart); </span>
- Data Element Changed:Trigger the event if a specified data element changes. Enter the data element name. You can select the data element from a list by clicking the icon and then selecting the data element. Launch will check the data element for changes every second, and trigger if there is a change. This form is usually used in single-page applications. If the user leaves soon, it may not trigger.
- Direct Call:Direct call rules are ideal for situations where you want to tell Launch exactly what is happening. Also, they are ideal when Launch cannot detect an event in the DOM, such as with Adobe Flash.
- Element Exists:Trigger the event if a specified element exists.
- Enters Viewport:Trigger the event if the user enters a specified viewport.In addition, configure whether the rule is triggered immediately or after a specified number of milliseconds.
- History Change:Trigger the event if a pushState or hash change occurs.
- Time Spent on Page:Trigger the event if the user remains on the page for a specified number of seconds.
Page Load Events
- DOM Ready:Trigger when the DOM is ready and the user can interact with the page
- Library Loaded (Page Top):Trigger the event as soon as the Launch library is loaded.
- Page Bottom:Trigger the event once _satellite.pageBottom(); has been called. When loading the Launch library asynchronously, this event type should not be used.
- Window Loaded:Trigger the event when onLoad is called by the browser and the page has finished loading.
Condition Types
This section describes the condition types available in the Core extension. Condition is a restriction on the event, making it more accurate.
Data
- Custom Code:Specify any custom code that must exist as a condition of the event. Use the built-in code editor to enter the custom code.
-
Value Comparison:Compares two values to determine whether this condition returns true. If you have a rule with multiple conditions, it is possible that this condition will return true, but the rule will still not fire because the other conditions evaluate as false or one of the exceptions evaluates as true.
-
Variable:Specify the JavaScript variable name and value that must exist for an event to trigger an action.
Engagement
- Landing Page:Specify the page the user must land on to trigger the event.
- New/Returning Visitor:Specify whether the visitor should be a new visitor or a returning visitor for an event to trigger an action.
- Page Views:Configure the number of times the visitor must view the page before the action is triggered.
- Sessions:Trigger the action if the user’s number of sessions meets the specified criteria.
- Time On Site:Trigger the action if the user’s number of sessions meets the specified criteria.Configure how long the visitor must be on the site before the action is triggered.
- Traffic Source:Trigger the action if the user’s number of sessions meets the specified criteria.
Other
- Date Range:Specify a date range. Choose the date and time the event occurs after, the date it occurs before, and the time zone.
- Max Frequency:Specify the maximum number of times the condition returns true. Include Page view、Sessions、Visitor、Seconds、Minutes、Days、Weeks、Months
- Sampling:Specify the percentage of the time the condition returns true.
Technology
- Browser:Select the browser the visitor must use for the action to be triggered. Include Chrome、Firefox、Internet Explorer/Edge、Internet Explorer Mobile、Mobile Safari、OmniWeb、Opera、Opera Mini、Opera Mobile、Safari、Device Type:Select the device type the visitor must use for the action to be triggered. Include Android、Blackberry、Desktop、iPad、iPhone、iPod、Nokia、Windows Phone、Operating SystemSelect the operating system the visitor must use for the action to be triggered. Include Android、Blackberry、iOS、Linux、MacOS、Maemo、Symbian OS、Unix、Windows
- Screen Resolution:Select the screen resolution visitors must use on their devices for the action to be triggered.
- Window Size:Select the window size visitors must use on their devices for the action to be triggered.
URL
- Domain:Specify the visitor’s domain.
- Hash:Specify one or more hash patterns that must exist in the URL.
- Path:Specify one or more paths that must exist in the URL.
- Protocol:Specify the protocol used in the URL,including HTTP and HTTPS
- Subdomain:Specify one or more subdomains that must exist in the URL.
- URL Parameter:Specify URL parameter used in the URL.