Don't have one? Create one ↗
Fire your first tags

Hands-on module

Variables: read data on the page

Pull values out of the page and the URL so your tags have something to say.

Triggers decide when a tag runs; variables decide what it can say. This module is your first pass at reading data that's already present on the page and in the URL, no dataLayer required.

You'll switch on the built-in page variables, store a reusable Constant, read the clicked element's attributes, pull a query parameter out of the URL, and read a value off a global JavaScript object.

What you'll learn

  • Enable and use the built-in page variables (URL, Path, Hostname, Referrer)
  • Keep one value in a Constant and reuse it across every tag
  • Read the clicked element with an Auto-Event Variable
  • Pull UTM and query parameters with a URL variable, and a global with a JavaScript variable