Variable Formats
Use double curly braces for variables:- Template format:
{{ variable.path }}— Use a path to the value (e.g.{{ query.campaign }},{{ customer.name }}).
%DAY_NAME%, %YEAR%) as shown in the Date Variables section below.
Date Variables
Display current date and time information using these placeholders:%DAY_NAME%
Full name of the day of the week.
Example: “Monday”, “Tuesday”, “Wednesday”
%DAY%
Day of the month (1-31).
Example: 1, 15, 31
%DAY_POSTFIX%
Ordinal suffix for the day (st, nd, rd, th).
Example: “st”, “nd”, “rd”, “th”
%MONTH_NAME%
Full name of the month.
Example: “January”, “February”, “March”
%MONTH%
Month number (0-11, where 0 = January).
Example: 0, 5, 11
%YEAR%
Full 4-digit year.
Example: 2024, 2025
%HOUR%
Current hour in 24-hour format (0-23).
Example: 0, 14, 23
Complete Date Example
Customer Variables
Display customer information when a customer session exists.%CUSTOMER_FNAME%
Customer’s first name from session.
%CUSTOMER_FNAME%,
Customer’s first name with a trailing comma. The comma is removed if no first name is available.
{{ customer_name }}
Customer’s full name. Works in both HTML and JavaScript.
{{ customer.* }} Variables
Access detailed customer information using the {{ customer.* }} format. These variables are populated from the customer’s most recent conversion/purchase.
Personal Information:
{{ customer.email }}- Customer email address{{ customer.name }}- Full name{{ customer.first_name }}- First name{{ customer.last_name }}- Last name{{ customer.phone }}- Phone number{{ customer.country }}- Country
{{ customer.address }}- Street address{{ customer.city }}- City{{ customer.state }}- State/Province{{ customer.zip }}- ZIP/Postal code
{{ customer.billing_address }}- Billing street address{{ customer.billing_city }}- Billing city{{ customer.billing_state }}- Billing state{{ customer.billing_zip }}- Billing ZIP code{{ customer.billing_country }}- Billing country
{{ customer.shipping_address }}- Shipping street address{{ customer.shipping_city }}- Shipping city{{ customer.shipping_state }}- Shipping state{{ customer.shipping_zip }}- Shipping ZIP code{{ customer.shipping_country }}- Shipping country
{{ customer.total_orders }}- Total number of orders{{ customer.last_order_date }}- Date of most recent order{{ customer.last_order_total }}- Total amount of most recent order{{ customer.last_order_currency }}- Currency of most recent order{{ customer.order_ids }}- Comma-separated list of order IDs
{{ customer.email_hashed }}- SHA-256 hashed email (for privacy/analytics)
Customer Variable Examples
- Customer variables require a valid customer session (email or
is_customerflag) - If no session exists, customer variables are removed from the page
- Variables are populated from the most recent conversion/purchase
- Empty values are replaced with empty strings
Brand & System Variables
Display brand information and system-level data that’s available on all pages.{{ brand_name }}
Your brand/company name.
{{ domain }}
Current domain name.
{{ click_id }}
Click tracking ID for the current session.
IP & Location Variables
Access visitor IP address and location information (when available).{{ ip_whois.ip }}
Visitor’s IP address.
{{ ip_whois.country }}
Visitor’s country based on IP geolocation.
{{ ip_whois.city }}
Visitor’s city based on IP geolocation.
{{ ip_whois.region }}
Visitor’s region/state based on IP geolocation.
- IP geolocation data is approximate and may not be 100% accurate
- Location data is only available when
{{ ip_whois.* }}variables are used in the page - IP address is always available, but country/city/region require geolocation lookup
- Use these variables responsibly and in compliance with privacy regulations
Custom Brand Variables ({{ var.* }})
Access custom variables defined in your brand settings using dot notation.
Format: {{ var.path.to.variable }}
Default Values: {{ var.path.to.variable=default_value }}
Custom brand variables are defined in your brand settings as JSON. You can access nested values using dot notation.
Example Brand Variables JSON:
- Custom variables are defined in your brand settings
- Use dot notation to access nested values
- Variables work in HTML, head HTML, and JavaScript
- If a variable doesn’t exist and no default is provided, you’ll see:
<ef-undefined>undefined: var.path</ef-undefined> - Default values are only used when the variable is undefined
Brand Variable Examples
Query Parameter Variables
Access URL query parameters to personalize content based on traffic source, campaigns, or other URL data.{{ query.* }}
Access any query parameter from the URL.
Format: {{ query.parameter_name }}
Example URL: https://yoursite.com/page?aff_id=123&source=facebook
{{ queryparams }}
Get the complete query string for use in URLs.
Query Parameter Examples
- Query parameters are case-sensitive
- If a parameter doesn’t exist, the variable is replaced with an empty string
- All query parameter values are automatically escaped for security
- Unused query parameter variables are cleaned up automatically
Request & device context
Request and device fields are available in the backend template engine (server-side). They use the same data as Script Rule, so you can show or hide content by device, customer status, referrer, and merchant. Userequest.* in conditions and output, or is_mobile / is_tablet at the top level (same names as in script rules).
In template conditionals (@if)
In output ({{ }})
Available request fields
| Variable | Type | Description |
|---|---|---|
request.is_mobile | Boolean | Visitor is on a mobile device |
request.is_tablet | Boolean | Visitor is on a tablet |
request.device | Object | Device info: type, user_agent, vendor, model, os, browser (name/version) |
request.query | Object | URL query parameters (same as {{ query.* }}) |
request.is_customer | Boolean | Visitor has made a purchase |
request.referer / request.referrer | String | Referrer URL |
request.merchant_code | String | Active payment processor code (e.g. buygoods, stripe) |
Top-level parity with script rules
For the same naming as in Script Rule,is_mobile and is_tablet are also available at the top level (no request. prefix):
Variable Usage Tips
Combining Variables
You can combine multiple variables for rich personalization:Conditional Display
Use variables with CSS or JavaScript for conditional display:Security Considerations
- All variable values are automatically escaped to prevent XSS attacks
- Customer data is only shown to authenticated customers
- Query parameters are sanitized before use
- Empty variables are safely removed
Performance
- Variables are replaced server-side during page rendering
- No client-side processing required
- Variables that don’t exist are efficiently removed
Troubleshooting
Variables Not Showing
Issue: Variable appears as literal text (e.g.,%DAY_NAME% instead of “Monday”)
Solutions:
- Check spelling and case sensitivity
- Ensure you’re using double curly braces:
{{ variable.path }} - Verify the variable name matches exactly
Customer Variables Empty
Issue:{{ customer.* }} variables are empty or removed
Solutions:
- Ensure visitor has a customer session (email or
is_customerflag) - Check that customer has made at least one purchase
- Verify the variable name is correct
Query Parameters Not Working
Issue:{{ query.* }} variables are empty
Solutions:
- Verify the parameter exists in the URL
- Check parameter name spelling (case-sensitive)
- Ensure the URL includes
?parameter=valueformat
Related Documentation
- Order Tag - Display customer order history
- Product Item Tag - Display product listings
- Collection Item Tag - Display collection entries