Page URL
Returns the address of the current page. A variable is a named value: GTM can ask for Page URL at the moment it needs it, then use that value in a condition, trigger, or tag.
MICHAEL CASTRO / GUIDE
The Starter Kit is not a pile of tags. It is a small vocabulary for describing what happened on a website. Start with primitive values, then watch them compose into reusable measurement logic.
HOW TO READ THE SYSTEM
STARTER KIT REFERENCE
Each section expands the Note included inside GTM and introduces the underlying web or computer-science idea only where it makes the implementation easier to understand.
Returns the address of the current page. A variable is a named value: GTM can ask for Page URL at the moment it needs it, then use that value in a condition, trigger, or tag.
Returns the hostname of the current page, such as example.com. It is a smaller, more specific piece of the full URL and is useful when logic depends on the site or subdomain rather than the entire address.
Returns the path portion of the current URL, such as /pricing. Separating a URL into parts lets measurement logic describe intent more cleanly: Page Path contains /pricing is easier to reason about than matching a complete URL.
Returns the referring URL available to the browser. A referrer is context: it describes where the current page navigation came from. The Starter Kit later derives Referrer Hostname from this more primitive value.
Returns the name of the current GTM event. GTM is event-driven: instead of running one linear program from beginning to end, it reacts as page loads, clicks and other interactions occur.
Returns the actual HTML element associated with a click. Unlike a text value, this is an object representing part of the page’s Document Object Model. More advanced Starter Kit components can inspect it and move through its relationships.
Returns the destination URL associated with a clicked link. Other Starter Kit components derive the hostname, path and file extension from this value instead of repeatedly solving the same problem.
Returns text associated with a click. It can be useful context, but the exact clicked node is not always the element a person conceptually interacted with. That limitation motivates the later Closest Interactive Element and Interaction Label Starter Kit components.
Stores one reusable value for the Google Analytics Measurement ID. A constant is a value intended to stay the same while the container runs. The included G-0000000 value is deliberately a placeholder and must be replaced before publishing.
Returns only the hostname of Click URL, such as example.com, with www removed. This is a derived variable: it takes a more general input and transforms it into the specific value needed for classification and conditions.
Returns only the path of Click URL, such as /pricing. It demonstrates a useful programming pattern: normalize complex input into smaller values that can be compared reliably.
Returns the filename extension from Click URL, such as pdf or xlsx. The File Download Click trigger later uses this returned value as an input to a condition.
Returns only the hostname from Referrer. This is another example of composition: a primitive browser value becomes a more useful Starter Kit component without changing the original value.
Returns the HTML element type involved in an interaction, such as BUTTON, SPAN, INPUT, or A. HTML elements are the structural objects that make up a web page; their type is one clue to what an interaction means.
Returns the id attribute of the clicked HTML element. An ID is intended to identify a particular element in a document, making it useful when a site provides stable, meaningful IDs.
Returns the aria-label attribute. ARIA labels provide accessible names for controls that may not have useful visible text, so they can also provide meaningful interaction context when used carefully.
Starts with Click Element and asks the browser for the nearest link, button, form control, or common ARIA control. This solves a common DOM problem: a person clicks an icon or span nested inside the button they actually meant to activate.
Returns the best available human-readable label for Closest Interactive Element. It checks sources in a deliberate order—accessibility label, normalized visible text, then descriptive attributes—and returns the first useful value. Input values are intentionally excluded as a privacy safeguard.
Describes the resolved interactive element using its role, type attribute, or HTML tag. This is an abstraction layer: downstream logic can ask what kind of interaction occurred without repeating the DOM inspection.
Returns true when the resolved interactive element is interactive but is not a standard or ARIA link. A Boolean has only two values—true or false—which makes it ideal for trigger conditions. The question-style name is intentional: “Is Interactive Non-Link? equals true” reads like a sentence.
Compares the clicked link hostname with the current page hostname and returns true when they differ, treating www and non-www as the same host. It turns several operations into one reusable yes-or-no question.
Listens for link clicks and provides a reusable base trigger. A trigger is a condition for execution: it answers when a tag should be allowed to run. Duplicate this base and add conditions instead of rebuilding link-click logic each time.
Fires when Is Interactive Non-Link? equals true. This shows how Starter Kit components compose: the trigger does not need to understand the DOM because the Boolean variable has already reduced that complexity to true or false.
Fires when Is External Link? equals true. Duplicate it and add Page Path or Click Hostname conditions when the business question requires a narrower definition.
Uses Click File Extension and a regular-expression pattern to recognize common downloadable files. A regular expression is a compact language for matching text patterns. Google Analytics Enhanced Measurement may already collect file_download, so check before attaching another GA4 file-download tag.
Composes Environment Name, Container ID and Container Version into one gtm_context value. This demonstrates why small Starter Kit components matter: simple primitive values can be assembled into richer diagnostic context without hard-coding it into every tag.
Uses the Measurement ID and shared Event Settings to load Google Analytics. Tags are outputs/actions in GTM: variables supply values, triggers decide when, and the tag performs the work. The Starter Kit deliberately fires it on Initialization and leaves the Measurement ID as a safe placeholder.
THE PATTERN
The goal is not to make every GTM user a JavaScript developer. It is to make the logic visible enough that a marketer can understand what a system knows, why a condition is true, and what happens next.