-
Notifications
You must be signed in to change notification settings - Fork 1
Variables
Osvaldo edited this page May 13, 2023
·
6 revisions
Variables are easy to use ways to access data about the page, the user's browser or the current date+time.
They can be used in tags, both on the condition or procedure section. They can also be used in triggers.
container.variables.pathcontainer.variables.titlecontainer.variables.referrer container.variables.origincontainer.variables.hashFor example:
container.variables.param("utm_source")For example:
container.variables.form("#myform")
container.variables.form("#myform").email container.variables.now.datecontainer.variables.now.yearcontainer.variables.now.monthcontainer.variables.now.daycontainer.variables.now.weekday(1 is Sunday, 7 is Saturday)
container.variables.now.hourcontainer.variables.now.minutecontainer.variables.now.timezonecontainer.variables.now.timezoneOffsetCookie handling variables are useful mainly to integrate with a cookie consent system using container.consent.
Please note that setCookie and deleteCookie may not work for certain cookies, depending on path and domain. Always test.
The first parameter is the cookie name, followed by cookie value and number of days until it expires.
container.variables.setCookie("foo", "bar", 5); container.variables.getCookie("foo"); container.variables.deleteCookie("foo");