Query Params
On page load, the template reads each param you list. It sends the ones that have a value as custom props on the goal Query Params.
Set up
- Add the Plausible template as a tag. Set Type to Initialization and enter your Script ID.
- Tick Enable Query Param Tracking.
- Add these rows:
utm_source,utm_medium,utm_campaign. - Do not add
secret. It checks that unlisted params are ignored. - Fire the tag on the Initialization or All Pages trigger. Open GTM preview mode on this site.
- In Plausible, create a custom event goal named
Query Params. - If the props do not show up, add them under the site's custom properties settings.
Test
Click each link. Each click is a full page load, which fires the tag again.
- One param
- Three params
- Listed and unlisted
- Only unlisted
- Empty value
- Same param twice
- Encoded value
- No params
Expect
- One param sends a
Query Paramsgoal withutm_source = newsletter. - Three params send one goal with all three props.
- Listed and unlisted sends one goal with
utm_source = twitteronly. - Only unlisted sends no
Query Paramsgoal. - An empty value sends no goal, because the template skips empty values.
- A repeated param should send the first value,
first. This follows from the template code. Confirm it. - An encoded value should arrive decoded, as
spring sale & more. - No params sends no
Query Paramsgoal.