Load rules are used to determine when a tag should load on your site. Rules are made up of one or more logical conditions based on values in the data layer. If the conditions evaluate to true, then tags are loaded. If they are false, then tags are not loaded.

The page_type variable is often used in load rules because its values represent the types of pages of your site e.g., "category", "product", "cart", and "order", which makes it ideal for creating rules to load tags on those pages of your site.

You can manage load rules directly from the tag configuration window or from the Load Rules screen. The default load rule is "All Pages", which means the tag will load on every page where the Tealium tag is installed. To only load a tag on certain pages, a new load rule with a condition is needed.

Conditions are formed using the following parts:

getting-started-load-rule-condition.png
  • Variable
    The data layer variable whose value will be used in the rule.
  • Comparison Operator
    The method used to compare the variable against another value, such as "equals", "contains", "greater than", or "is not populated".
  • Comparison Value
    The value used in the comparison.

Example

In the following example, checks are made to ensure that the current page is the shopping cart page:

page_type equals "cart"

  • Data Layer Variable: page_type
  • Comparison Operator: equals
  • Comparison Value: "cart"

In this lesson, you will create a rule that identifies the live production website so that you can ensure that your tag is never loaded on your QA/staging site. The rule will check to ensure that the built-in variable named domain does not contain the words "stage" or "qa", which would indicate that it's the production site (i.e. if the domain is "qa.yourdomain.com", the rule will be false).

Use the following steps to add this load rule:

  1. Click the Google Analytics tag you just created to expand the available options.
  2. In the Load Rules area, click Edit.
    getting-started-iq-edit-load-rule.png
  3. Click +Create Rule.
    The new load rule dialog displays.
  4. In the Title field, enter Production Site.
  5. In the first drop-down list, select domain.
  6. In the second drop-down list, select does not contain as the operator.
  7. In the third field, enter stage.
  8. Click the + button to add an AND condition.
    getting-started-iq-load-rule-add-and-condition.png
  9. In the first drop-down list, select domain.
  10. In the second drop-down list, select does not contain as the operator.
  11. In the third field, enter qa.
    getting-started-iq-load-rule-new.png
  12. Click Apply to apply the load rule.
  13. Click Apply again to update the tag.

Great! You now have a tag that will only load on the production site (no domains that contain "stage" or "qa"). Click Next to see how to apply data mappings to send data to your tag.