If disabled, patterns will match when they are found anywhere in the input.Ĭapture Groups and Replace Functionality: If enabled, you can use dollar-sign replacement syntax to include portions of the input (e.g. This is equivalent to having start ( ^) and end ( $) anchors implicitly around your pattern. Ignore Case: Patterns will match uppercase and lowercase matches without having to build this into the regular expression explicitly.įull Matches Only: If enabled, patterns must match the entire input. This behavior can be adjusted in Advanced Settings:
Select Set Default Value to set an output value for when a match is not found.īy default, patterns must match the full input string and are case insensitive. When a match is found, the corresponding output value is returned. RegEx Table lookups run from the top of the list to the bottom. The output value of the variable will be as follows: Matched result RegEx TableĪ RegEx Table variable is similar to a Lookup Table variable, with the addition of being able to run regular expression patterns for the items you want to match.įor this RegEx Table configuration: Pattern The value is set to a random number between 483647. For example, a custom JavaScript variable can be created to convert all instances of the predefined contains The JavaScript must take the form of an anonymous function that returns a value. The value is set to the result of a JavaScript function. This value is the same is if you had called okie from within a page and chosen the first result. If more than one cookie with same name is deployed on the same domain, the first value will be chosen. This value is set to the value of the 1st party cookie with the name of the domain that the user is currently on. Adjust URL Source to tell Tag Manager to use another variable as the source of the URL value. The input value set for variables of this type is the URL of the current page the user is on (retrieved from document.location). The URL components you can choose from are: Full URL, Protocol, Hostname, Port, Path, Filename Extension, Query, and Fragment. You can create additional instances to expose different parts of the URL. This type of variable allows you to parse and expose URL components. An instance of this variable type is automatically created by Tag Manager, but you can create additional instances if you would like to have expose different parts of the referrer URL. For example, if a person navigates to one of your product pages from the home page, the referrer will be the home page. The value is set to the HTTP referer, which is the URL of the previous page that the person visited. Tag Manager supports these user-defined variable types for web:
Use a naming scheme that is descriptive of the variable's function, e.g. Enter configuration options for the selected variable type.Click Variable Configuration and select the desired variable type.In the User-Defined Variables section, click New.
In the left navigation, click Variables.Create custom user-defined web variables in Google Tag Manager to suit specific requirements that might not already be covered by built-in variables.