Back

Load rules are conditions that define when and where to load a tag. This article provides information on adding and managing load rules.

In this article:

How it Works

A load rule determines when a tag loads on your site or app. A load rule is one or more conditions that are based on the values in the data layer. For example, a load rule condition that identifies your search page might be:

page_type equals search

The default load rule is All Pages.

Boolean Logic

Multiple conditions can be combined using boolean logic to form more complex load rules. For example, to load a tag on the search page, but only when the user is not logged in, the load rule conditions might be:

page_type equals search
AND
is_logged_in equals 1

This complex logic can be combined into a single rule or created as two rules and then enforced using the Match All Rules setting.

AND Logic

Use AND logic to create a rule that is true only when all of the conditions evaluate to true. For example, a rule that combines 3 conditions using AND logic evaluates to true only if each individual condition also evaluates to true. If any of the conditions evaluate to false, then the entire rule also evaluates to false.

OR Logic

Use OR logic to create a rule that is true when any of the conditions evaluate to true. For example, a rule that combines 3 conditions using OR logic evaluates to true if any of the individual conditions also evaluate to true. A rule that uses OR logic only evaluates to false if all of the individual conditions also evaluate to false.

Comparison Operators

Each rule condition uses a comparison operator and a variable from the data layer. The following table lists the available comparison operators that can be used in load rule conditions. For operators that include (ignore case) in the name, the text value of the variable is converted to lowercase before the comparison.

Comparison Operator When a tag loads on a page
contains
contains (ignore case)
The variable contains the specified sequence of characters.
does not contain
does not contain (ignore case)
The variable does not contain the specified sequence of characters.
does not end with
does not end with (ignore case)
The variable does not end with the specified sequence of characters.
does not equal
does not equal (ignore case)
The variable does not equal the specified value.
does not start with
does not start with (ignore case)
The variable does not start with the specified string of characters.
ends with
ends with (ignore case)
The variable does not end with the specified string of characters.
equals
equals (ignore case)
The variable equals the specified value.
greater than The variable is greater than the specified value.
greater than or equal to The variable is greater than or equal to the specified value.
is badge assigned The badge is assigned to the visitor.
For use with data layer enrichment.
is badge not assigned The badge is not assigned to the visitor.
For use with data layer enrichment.
is defined The variable is defined in the data layer.
is not defined The variable is not defined in the data layer.
is populated The variable is defined in the data layer and is not blank or empty.
is not populated The variable is defined in the data layer and is blank or empty.
less than The variable is less than the specified value.
less than or equal to The variable is less than or equal to the specified value.
regular expression The variable matches the regular expression.
starts with
starts with (ignore case)
The variable begins with the specified sequence of characters. 

Managing Load Rules

Load rules can be managed either from the Load Rules screen or from the expanded tag details screen. 

In the list view, the Mapped column displays the number of tags scoped to the load rule. For example, 1/2 indicates that the load rule is assigned to 2 tags, but only 1 is active.

The UID column displays the numeric identifier for each load rule. This value can be useful when debugging utag.js.

Creating a Load Rule

Use the following steps to create a load rule:

  1. On the Load Rules screen, click + Add Load Rule.
    The Load Rules: New dialog is displayed.
  2. Use the drop-down lists to select a variable and a comparison operator, then enter a comparison value.
    TiQ_load_rule_creation.png
  3. To add a condition using AND logic, click + next to the default conditional statement.
    To add a condition using OR logic, click Add OR Condition.
    For more information, see Boolean Logic.
  4. To finish click Apply.

Assigning Load Rules to a Tag

To assign load rules to a tag, expand the tag details and click Edit in the load rules area.

You can also create, edit, copy, activate, deactivate, and delete load rules from the tag details area.

Select the checkbox next to the load rule that you want to scope to the tag.

If you select more than one load rule the following options are available to determine which boolean logic to apply to the selected load rules:

  • Match All Rules
    Select this option to apply AND logic to the load rules. The tag loads only when all of the selected load rules evaluate to true.
  • Match Any Rule
    Select this option to apply OR logic to the load rules. This tag loads when any of the selected load rules evaluate to true.

Viewing Load Rule Details

On the Load Rules screen, click a load rule to expand its details.
TiQ_load_rule_details.pngThe Load Rule Configuration section displays the title and logical conditions of the rule.
The Tags section displays a list of the tags scoped to the load rule. To jump to a scoped tag, click the arrow next to the tag UID.

To add an optional label to a load rule, click Apply Labels, enter the label text, and click the arrow.
Labels can be used to organize and uniquely identify rules in your profile.

Activating or Deactivating a Load Rule

Deactivating a load rule turns it off, but keeps it in your profile for future use. When a load rule is deactivated, it remains in the profile and can be reactivated later.

To deactivate a load rule, go to the Load Rules screen, then click the ON toggle button of the load rule that you want to deactivate.
WhiteUI_TiQ_Load Rule Toggle ON.png
The toggle button changes to display OFF.
WhiteUI_TiQ_Load Rule Toggle OFF.png

To reactivate a load rule, click the OFF toggle button.

Deleting a Load Rule

You can delete a load rule to remove it from the profile. Deleting a load rule removes all instances of that load rule from the utag.js file.

Use the following steps to delete a load rule:

  1. On the Load Rules screen, click the load rule that you want to delete to view the configuration details for the rule.
  2. Click Delete.
    A confirmation dialog is displayed.
  3. To confirm, click Delete Load Rule, otherwise, click Cancel.
    TiQ_load_rule_deletion_prompt.png
  4. If the load rule you want to delete is scoped to a tag, a message is displayed with the tag details.
    TiQ_load_rule_deletion_prompt_with_tags.png
  5. To continue and delete the load rule, click Delete Load Rule.

Examples

AND Logic

The following example shows a load rule to identify the checkout page of the site for a customer that is buying shoes. This example uses an AND condition, so the following two conditions must be met:

  • pathname contains checkout.html
  • product_category contains (ignore case) shoes

If both conditions are true, the load rule evaluates to true.
If any of the conditions in an AND statement are false, the load rule evaluates to false.
TiQ_load_rule_AND_condition.png

OR Logic

The following example uses an OR condition. This rule loads a tag on a page if the pathname contains checkout.html OR if the product_category contains shoes. If one of the statements is true, the rule evaluates to true. If all of the statements in an OR statement are false, the load rule evaluates to false.

TiQ_load_rule_OR_condition.png

Using URL Components in Load Rules

The components of a URL can be useful when creating load rule conditions. A URL typically consists of the following components:

  • Protocol – The method used to process the URL. For example, http or https.
  • Domain – The domain name. For example, www.tealium.com.
  • Path – The section and page on the site.
  • Hash – Begins with a hash mark (#) and identifies a section within the page.
  • Query String – Begins with a question mark (?) and specifies key/value parameters containing dynamic data passed to the page.

URL Example:

http://www.tealium.com/app/solutions/?example=test&example2=test2#section3

Data Layer Variables

In the data layer, the components of a page URL are stored in DOM variables, as follows:

dom.domain       : "www.tealium.com"
dom.pathname     : "/app/solutions/"
dom.query_string : "example=test&example2=test2"
dom.hash         : "section3"
dom.url          : "http://www.tealium.com/app/solutions/?example=test&example2=test2#section3"

Example using Domain

If a site consists of several domains, you may need to create a load rule to load tags for pages in a specific domain. The following example shows a load rule for pages in domain1.com :
TiQ_load_rule_domain.png

Example Using Domain AND Pathname

To load tags on the homepage for domain1.com, use the following rule:
TiQ_load_rule_domain_pathname.png

Pathname

To load tags on pages in the support section of domain1, use the following rule:
TiQ_load_rule_pathname.png

Pathname AND Hash, OR Querystring

To load tags for support pages containing a section named section2 or when there is a query string that contains support=true, use the following rule:
TiQ_load_rule_pathname_hash_querystring.png

Using Time-Based Conditions

You can use time-based conditions, which specify a date and time range, in a load rule along with one or more variable conditions. The date and time range specifies a time period in which the tag is loaded on pages.

Time-based conditions must be used with at least one variable condition, otherwise the load rule always evaluates to false.

Use the following steps to add a date range condition to a load rule.

  1. Click Add Date Range Condition.
    The date and time range fields are added to the Load Rules dialog.
    load-rules-time-based.png
  2. Click in the Start and End fields to select the start and end dates.
  3. Click in each time field to select a time of date to start and end.
  4. If the load rule does not contain a variable condition already, create one.
  5. Click Apply to create the load rule.
    You can now use this load rule to control when a tag loads.

Special Considerations

The following special considerations may apply:

  • If the Start or End fields are empty, the default values any day and any time are used.
  • The date or time that is highlighted when you click on a field is the current date or time.
  • You can specify only one date range condition per load rule.
    • To apply more than one date range to a tag, you must create another load rule with the second date range.
    • When multiple load rules are applied to a tag, the tag is loaded only when the conditions for both load rules are met.
  • To manually enter a value in a date or time field, click in that field.
    • Date – You must enter the date in the following format: MM/DD/YYYY.
      For example, April 5th, 2019 must be entered as 04/05/2019.
    • Time – You can enter the time in standard or format, as ##:## AM (or PM).
      If you do not specify AM or PM, the default is AM.
      Minute values must be entered as increments of five (5).
  • The time/time zone used for the load rules is determined by the visitor's browser, not the server or the visitor's time/time zone.

To use UTC time instead of the browser's local time, see Time-based Load Rule using UTC.

Public