Custom Variable Template for Server-Side Google Tag Manager
Extract a parameter (e.g. fbclid
or gclid
) value from URLs event data like page_location
or a request parameter
Note: This template does not need any permissions.
-
Create a variable to extract a request parameter (like
dl
from a raw Universal Analytics request) or event data field (likepage_location
) where the desired parameter value can be found. -
Create a new variable with this template.
-
Choose the variable from the first step as input. Then define the name of the desired parameter.
-
The variable will find and return the parameter value. If the parameter is not present, you can pick either an empty string or
undefined
as return value.