Quick Reference
Condition Types
First Visit
Is this the first time the user has visited the site.
Direct Visit
Has the user visited the site directly or where they referred from another site.
Lead Score
The user’s lead score as a numeric value.
Lead score values will be an integer, such as: 1, 2, 5, 10, 0, -3, -20
Location
Is the visitor located in a specific country, region, city, etc.
Location is derived from users’ IP address and my be imprecise.
Note: For best results use case-insensitive operators.
Reference
- Country
- State/Region
- 2 Letter Code – Code: ISO Alpha-2 Code
- ZIP Code
- 5 Digit Code (US), Alphanumeric (Others)
- Time Zone
- Example America/Los_Angeles, Europe/London Time Zones
Language
What is the visitor’s browser language set to.
Note: For best results use case-insensitive operators.
- 2 Letter Code – ISO 639-1 Code
- Lowercase
- Example: en, fr, zh
IP Address
Is the visitor’s IP Address a specific value.
IP Address Contains
Does the visitor’s IP Address contain a specific value.
Operating System
The visitor’s operating system.
Possible values:
- Windows
- macOS
- Linux
- iOS
- Android
- BlackBerry
- Unknown
Mobile Device
Is the visitor on a mobile device. (Smartphone or tablet)
Mobile OS
The mobile operating system. Either ios or android
Deprecated: Use Operating System instead
Tablet
Is the visitor on a tablet.
Time Elapsed
The amount of time that has elapsed since the:
- Last page was visited
- Current Session
- This visit started
- Current Session
- Last visit to the site
- Previous Session
- First visit to the site
- First Session
Goal – All Visits
Has a specific Goal been completed or not completed by the visitor.
Goal – Current Session
Has a specific Goal been completed or not completed by the visitor during the current session.
Goal Count – All Visits
Has many times a specific Goal been completed by the visitor.
Goal Count – Current Session
Has many times a specific Goal been completed by the visitor during the current session.
Goal Views – All Visits
The number of times the current visitor has completed a specific Goal.
Goal Views – Current Session
The number of times the visitor has completed a specific Goal during the current session.
Current Page
The currently active page.
Current Page Views – All Visits
The number of times the current page has been viewed by the current visitor.
Current Page Views – Current Session
The number of times the current page has been viewed by the visitor during the current session.
Total Page Views – All Visits
The number of all page views combined for the current visitor.
Total Page Views – Current Session
The number of all page views combined during the current session.
Specific Page Views – All Visits
The number of times the current user has viewed a specific page.
Specific Page Views – Current Session
The number of times the user has viewed a specific page during the current session.
URL Path
The current URL path of the visitor.
- Everything following the domain name
- Does not include query strings or hash values
- Example: A page titled About Us would appear as
- /about-us/
Referrer
The current referring URL of the visitor.
- Full path including query string
- Internal and external referrers
Empty Referrer Value
It is important to note that it is very possible to have an empty Referrer value. This can occur when the user:
- Entered the site URL in their browser address bar
- Switched from a HTTPS URL to a HTTP URL
- Clicked on a link with rel=”noreferrer”
- Visited the site from a browser-maintained bookmark
- Visited the site as first page in the window/tab
- Clicked a link in an external application
- Is behind a proxy which strips the referrer from all requests
- Has security software installed which strips the referrer
- Visited the site programmatically without setting the referrer header
In lieu of relying on the Referrer variable it is best to use Query String variables.
Landing Page – First Visit
The visitor’s landing page from the first visit.
- WordPress Slug with slashes.
- Example: A page titled About Us would appear as
- /about-us/
- Home page is a single slash: /
Landing Page – Current Visit
The visitor’s landing page from the current visit.
- WordPress Slug with slashes.
- Example: A page titled About Us would appear as
- /about-us/
- Home page is a single slash: /
Query String
Is the query string variable set to a specific value.
-
Value of a query string variable
-
Case-Sensitive
-
Example: http://logichop.com/?animal=kangaroo
- Variable is “animal”
- Value is “kangaroo”
Note: Query Strings that contain spaces & special characters are often URL encoded. When specifying the value of a variable, do so without the URL encoding.
- Example: http://logichop.com/?email=email%20newsletter
- Condition value evaulated as email newsletter
Query String Session
Has the query string variable been set to a specific value at any time during the current session.
- See Query String condition for details
- Data remains until user quits browser
- Most recent value stored for duplicate variables
Query String Contains
Does the query string variable contain a specific value.
Query String Session Contains
Does the query string variable contain a specific value during the current session.
In Category
Is the current post in a specific category
Category Views – All Visits
The number of times the category has been viewed by the current visitor.
Category Views – Current Session
The number of times the category has been viewed by the visitor during the current session.
Has Tag
Does the current post have a specific tag
Tag Views – All Visits
The number of times the tag has been viewed by the current visitor.
Tag Views – Current Session
The number of times the tag has been viewed by the visitor during the current session.
User Is
Is the visitor currently logged in to WordPress.
User Data
Evaluates data stored data for logged in visitors.
Data options include:
- Role
- Email Address
- First Name
- Last Name
- Display Name
- Nice Name
- User ID
Day of the Week
The current day of the week starting with Monday, ending with Sunday.
- Example:
- Tuesday is less than Friday.
- Saturday is greater than Wednesday.
Based on WordPress date & time.
Day
The current numerical day of the month.
Based on WordPress date & time.
Month
The current month of the year starting with January, ending with December.
- Example:
- March is less than July
- October is greater than April
Based on WordPress date & time.
Year
The current year.
Based on WordPress date & time.
Hour
The current hour of the day.
- Example:
- 2am is less than 1pm
- 11pm is greater than 12am
Based on WordPress date & time.
Minutes
The current minute of the hour.
Most useful with Greater Than or Less Than operators.
Based on WordPress date & time.
Date
The current date with the format: mm/dd/yyyy.
- Example
- Halloween 2022 is 10/31/2022
Based on WordPress date & time.
User Day of the Week
The current day of the week starting with Monday, ending with Sunday.
- Example:
- Tuesday is less than Friday.
- Saturday is greater than Wednesday.
Based on the user’s browser date & time.
User Day
The current numerical day of the month.
Based on the user’s browser date & time.
User Month
The current month of the year starting with January, ending with December.
- Example:
- March is less than July
- October is greater than April
Based on the user’s browser date & time.
User Year
The current year.
Based on the user’s browser date & time.
User Hour
The current hour of the day.
- Example:
- 2am is less than 1pm
- 11pm is greater than 12am
Based on the user’s browser date & time.
User Minutes
The current minute of the hour.
Most useful with Greater Than or Less Than operators.
Based on the user’s browser date & time.
User Date
The current date with the format: mm/dd/yyyy.
- Example
- Halloween 2022 is 10/31/2022
Based on the user’s browser date & time.
User Path
The current visitor’s path through the site consisting of the 5 most recent pages.
- Up to 5 pages
- Leave pages unselected for fewer than 5
Cookie
Does a cookie exist with a specific value.
Cookie Contains
Does a cookie exist that contains specific value.
Server
Does a PHP $_SERVER parameter have a specific value.
Server Contains
Does a PHP $_SERVER parameter contain a specific value.
Custom Data Object
Is the Custom Data Object variable set to a specific value.
Learn more about extending Logic Hop with custom data.
Custom Data Object Contains
Does the Custom Data Object variable contain a specific value.
Learn more about extending Logic Hop with custom data.
Comparison Operators
Numeric, Text & Date Operators
- Equal To
- Greater Than
- Less Than or Equal To
- Greater Than or Equal To
- Less Than
- Not Equal To
- Is
- Is Not
- Is In List
- Is – Case-insensitive
- Is Not – Case-insensitive
- Is In List – Case-insensitive
Text Search Operators
- Contains
- Does Not Contain
- Contains – Case-insensitive
- Does Not Contain – Case-insensitive
User Operators
- Logged In
- Logged Out
Data Variables
Logic Hop exposes stored data variables for personalization using Logic Tags or via Javascript and PHP for use in themes and plugins.
Accessing Variables with Javascript
To retrieve a store value via Javascript, pass the variable name as a string into the __logichop_var()__ function.
Learn how to access variables with Javascript.
Accessing Variables with PHP
To retrieve a stored value via PHP, pass the variable name as a string into the __$logichop->get_data()__ method. Nested object variables should be referenced using dot notation, such as:
Location.City
Nested array values can be accessed using a semi-colon, such as:
Path:0
Echo Logic Hop data via PHP:
global $logichop;
$logichop->get_data('Location.City');
Return Logic Hop data via PHP:
global $logichop;
$location = $logichop->get_data('Location.City', false);
Viewing Stored Variables
Stored variables can be viewed when the Logic Hop setting Debug Mode is enabled on the settings page. Once Debug Mode has been enabled, append the query string ?debug=display to any page to output the variables.
When Javascript Mode is active ?debug=display is disabled. Instead, use the browser Javascript Console and enter logichop_debug(); to view stored variables.
Note: Debug Mode should only be used during testing and development – Make sure to disable this option for production websites.
Variable Reference
- UID
- FirstVisit
- boolean
- TotalVisits
- Timestamp
- FirstVisit
- LastVisit
- ThisVisit
- LastPage
- Mobile
- boolean
- Tablet
- boolean
- MobileOS
- IP
- IsBot
- boolean
- UserAgent
- URL
- Language
- Location
- Active
- boolean
- IP
- CountryCode
- CountryName
- RegionCode
- RegionName
- City
- ZIPCode
- TimeZone
- Latitude
- Longitude
- MetroCode
- EU
- boolean
- GDPR
- boolean
- Active
- LandingPage
- LandingPageSession
- LeadScore
- Source
- OS
- UserAgent
- LoggedIn
- boolean
- UserData
- ID
- user_email
- user_firstname
- user_lastname
- display_name
- user_nicename
- role
- Page
- Views
- Pages
- array
- Goals
- array
- PagesSession
- array
- GoalsSession
- array
- ViewsSession
- array
- Path
- array
- QueryStore
- array
- Query
- array
- Category
- Categories
- array
- CategoriesSession
- array
- Tag
- Tags
- array
- TagsSession
- array
- Referrer
- Date
- Timestamp
- DateTime
- Date
- Year
- LeapYear
- boolean
- Month
- MonthName
- Day
- DayName
- DayNumber
- DayYear
- Week
- Hour
- Hour24
- Minutes
- Seconds
- AM
- boolean
- PM
- boolean
- UserDate
- Timestamp
- DateTime
- Date
- Year
- LeapYear
- boolean
- Month
- MonthName
- Day
- DayName
- DayNumber
- DayYear
- Week
- Hour
- Hour24
- Minutes
- Seconds
- AM
- boolean
- PM
- boolean
- Condition
- boolean
- Custom
- object
- Token