
A JavaScript script handles the dialog and click tracking
The presented code controls the opening, tracking and closing of a dialog box on the site.
The video this brief is aboutThe provided snippet shows a script that selects a `<dialog>` element and a `.cta` link. It defines a function `trackClick` that, when a valid click occurs, sends a tracking event with the URL, the link text and the domain. The link receives its `href` if a destination is set, otherwise it is disabled and its title indicates that a URL must be provided. A logo may be injected into the `.brand` element. The script saves the scroll position and body styles before showing the dialog, then restores everything on close via the `close` function. All these actions are wrapped in an event handler. according to Large Screen