
- MODX 3
- PHP 8.2
- Vue 3


Result: the block is in the HTML only when the UTM rule matches. The value comes from the query string, then from $_SESSION['utm'].
The snippet and the plugin write the session only when a PHP session is already open. Reading the tag from $_GET does not depend on the session.
The UTM registry requires PageBuilder Pro and capability utm. Rules that are already published still run in Free.
pagebuilder_inspector_visibility_enabled is on. While it is off, the inspector has no Visibility button.OnHandleRequest in the web context. If it does not, put [[!PageBuilderUtmSession]] above [[!PageBuilder]].{{utm:key}}. utm rule. It checks $_GET[parameter] and $_GET['utm_' . parameter] first, then $_SESSION['utm'].The same dialog sets a list of MODX contexts. In Pro, with the conditions flag, settings.conditions covers guest, logged-in, MODX context, and GET. The Context type does not replace the separate section context list (settings.contexts).
On the UTM tab add parameter campaign. In section fields the placeholder is {{utm:campaign}}.
On a cta section set Visibility to a utm rule: parameter campaign, allowed value spring. Open ?campaign=spring. The section is in the HTML. Open ?campaign=other. The section is not in the HTML.
With the tag, the block is in the page source. Without the tag, the block is absent, not hidden with display: none. Turning off the inspector button does not erase rules that are already stored.
Clear the rule in the dialog and save the resource.