Encode values
Encode the part after each equals sign when it contains spaces, symbols, nested URLs, or platform tokens that break parsing.
URL safety guide
Encode URL values when the browser or ad platform needs it, but keep the tracking setup transparent so your team can still audit the final link.
Encode the part after each equals sign when it contains spaces, symbols, nested URLs, or platform tokens that break parsing.
Encoding is for valid URLs and stable parsing. It should not be used to hide redirects, customer data, or misleading destinations.
After encoding, open the final URL and verify the landing page, parameters, and GA4 Realtime view.
| Situation | Before | Safer encoded value |
|---|---|---|
| Space in campaign name | spring sale |
spring%20sale |
| Nested destination URL | https://store.com/products/a?color=red |
https%3A%2F%2Fstore.com%2Fproducts%2Fa%3Fcolor%3Dred |
| Pipe separated label | campaign|adset|ad |
campaign%7Cadset%7Cad |
| Curly-brace macro | {{ad.name}} |
%7B%7Bad.name%7D%7D |
This is easy for a human to inspect and usually fine for direct landing-page UTMs.
This is useful when a platform, redirect tool, or nested URL parser needs reserved characters encoded.
That tiny habit makes URL QA much less painful when ads, redirects, macros, and GA4 all meet at once.