The Universal Script is one tag. It must be in the <head> of every page a visitor can land on: landing pages, checkout, thank-you pages, booking pages and your main site.
Copy the tag
Tracking → Universal Script shows your tag. Pick how you are installing it along the top (1), then copy the tag with the button on the code (2).
The tag looks like this:
<script src="https://t.yourdomain.com/v1/lst/universal-script?ph=YOUR_ACCOUNT_ID&tag=!clicked" async></script>
ph is your account id. tag=!clicked labels every visit with the !clicked tag so you can tell "clicked an ad" traffic apart from everything else.
Installed the tag before 10 November 2026? Copy it again from Tracking → Universal Script and replace the old one. The old tag ended in &ref_url= followed by the page's address, which made every page load its own copy of the script from the network. The current tag has one address for your whole site, so a visitor's browser keeps the script after the first page and runs it at once on every page after that: tracking starts sooner, and the script reaches your page's Meta pixel in time to give its Lead the same event id Wexlyn sends (see Meta → Sending leads from Wexlyn as well as the pixel). Use the same tag on every page of a funnel; a page with a different tag= value loads its own copy.
Where to paste it
| Platform | Where |
|---|---|
| WordPress | Theme header or a "header scripts" plugin |
| Webflow | Project settings → Custom code → Head code |
| ClickFunnels / GoHighLevel funnels | Settings → Tracking code → Head |
| Shopify | theme.liquid inside <head>, and the checkout "additional scripts" box |
| Framer, Wix, Squarespace | Site settings → Custom code → Head |
| Custom site | Directly in the HTML template <head> |
Google Tag Manager works too, but place the tag as high as possible so it fires before the visitor leaves.
Have Claude Code install it
More and more funnels are built by Claude Code, Cursor, Lovable or Bolt rather than a funnel builder. Tracking → Universal Script has a Claude Code prompt tab: one prompt that already contains your script and tells the AI to put it in the head of every page of the website and funnel, in the head of every iframe document it built (embedded checkouts, calendars, forms, widgets), as a plain inline script that is never deferred, gated behind consent, bundled or routed through a tag manager, and to report every file it changed and any page it could not cover. Copy it, paste it into the AI tool, then check a page the way the next section describes.
Forms, surveys and calendars
Form · survey · calendar
in the builder's frame
Wexlyn tag as HTML inside
Redirect to the next page
/thank-you?email={{contact.email}}&phone={{contact.phone}}
Next page
tag reads email and phone from the URL
avery@… → Meta › Hook A
No inline "thank you" messages: a redirect is what lets the sale or the call on the next page land on the person who opted in.
Funnel builders such as GoHighLevel, ClickFunnels and Typeform render forms, surveys and calendars inside their own frame, and the page a person lands on afterwards is what ties the opt-in to the sale. Three habits make every one of them track cleanly:
- Every form, survey and calendar points to a next page. Set the form's or survey's on-submit action and the calendar's confirmation to Redirect to a URL (the next step, a thank-you page, a booking page), not an inline "thank you" message. A redirect gives Wexlyn a page view with the person on it; an inline message leaves them in the frame.
- The Wexlyn tag goes inside the form or survey as HTML. Paste the script tag into the builder's custom-code field for that form or survey (in GoHighLevel: the form or survey builder → Settings → Custom code / HTML, or an HTML element placed next to the email field). The tag on the surrounding page cannot see inside the builder's frame, so the one inside the form is what captures the email and phone as they are typed.
- End every redirect URL with the person's details. Add this to the end of the next-step or thank-you URL:
?email={{contact.email}}&phone={{contact.phone}}
The builder swaps the merge tags for the real values when it redirects (GoHighLevel uses {{contact.email}} and {{contact.phone}}; other builders have their own tags). The Wexlyn script on the landing page reads email and phone from the URL the moment it loads and assigns the person to the source that brought them, so the sale on the next page, or the call booked from it, lands on the same lead. If the URL already has a query string, join with & instead of ?. Merge tags that the builder leaves unreplaced are ignored.
The same three rules apply to a calendar: the booking confirmation redirects to a thank-you page carrying the invitee's email and phone, and the page carries the Wexlyn tag.
Confirm it works
Browser console
WEXLYNWexlyn tracking script firing.web v1.1.10
WEXLYNWexlyn visitor id.WX-9f2a…c7e1
WEXLYNWexlyn page view captured./offer
WEXLYNWexlyn form capture.live, as each field is left
- Open your site with
?utm_source=teston the URL. - Open the browser developer tools → Console. You should see lines starting with
[Wexlyn]describing the page view and parameters captured. - In Wexlyn, Tracking → Visitors shows the visit within a minute. The Check script button on the Universal Script page also confirms the tag on any URL you enter.
- Testing a whole funnel? Opt in with a test email, open that person in CRM → Leads and switch Live on at the top of the Journey. Each step you take on the site then appears there within a few seconds, without reloading. Live is off by default, waits while the tab is in the background and switches itself off after 10 minutes.
What the script captures
- Page URL, referrer, previous page and timestamp
- All ad parameters (
gc_id,fbc_id,ttc_id,h_ad_id,utm_*, click ids such asgclidandfbclid) - Emails and phone numbers typed into forms, so the lead can be matched later
- Clicks on links that leave your site (a "Start your Shopify trial" button, a checkout hosted elsewhere, an affiliate link), recorded on the journey as "Clicked out to …" with the destination
- Any element you mark with
data-wexlyn-event="name", recorded as an event with that name when it is clicked - How far videos are watched (YouTube, Wistia and Bunny Stream embeds, Mux Player, and any video with controls in the page itself): "Started watching …" and "Watched 25 / 50 / 75 / 95% of …" and "to the end", once each per video and page view. Nothing to set up: the script switches on YouTube's player API for each embed it finds and reads Wistia's player (both the current
<wistia-player>and the older E-v1 embeds); for Wistia the percentage is of the video actually seen, so skipping ahead does not count. A Bunny Stream embed (bunny.net, themediadelivery.netiframe) is read the same way, with no Bunny login or API key: the script asks the player on the page for its position and counts the seconds that were really played, so a skip to the end is not a watched video and a part watched twice counts once. Settings → Attribution → Conversion events can send a step to Meta, Google, X or LinkedIn with the trigger "Video watched 50%" (or any other step), matched on the visitor's click ids and cookies even before they opt in. Videos in the page itself (Mux Player's<mux-player>, a<video>inside a media-chrome<media-controller>, or any<video>with controls) are read from the browser's own play events and counted the same way, from what was really played; looping background clips are ignored. Vimeo is not read yet. - Where in the video the viewer is (videos in the page itself, Mux Player and Bunny Stream, from script version 1.7.0). Next to how much was played, the script follows the furthest point reached:
video_startsays the second playback began at (position) and whether this browser had already started the same video in this visit (resumed, as after a reload);video_positionis sent when the furthest point first passes 25, 50, 75 and 95% and when the player reaches the end;video_exitis sent as the page is left, with the furthest second reached. From script version 1.8.0 avideo_pingsays "still watching" while the video plays (every five minutes of a webinar, more often on a short video), so a tab closed without an exit, which phones do, loses a few minutes at most; a person's journey shows only the latest one ("Still watching … at 1:10:00"). Every video event of these players carriesposition(furthest second) andwatched(seconds really played). This is what a webinar room needs, where people join at the live point: Reporting → Video can count its steps by position and count who reached any moment of the recording. To send "got halfway into the webinar" to an ad platform, add a conversion event on the browser eventvideo_positionwith the propertypercent=50. - Private page areas (Tracking → Universal Script → Advanced settings): list one path per line, for example
/videos. For pages under such a path Wexlyn still records the visit, the ad click and the video steps, but not which page it was: the address is cut back to the path (/videos/any-titleis recorded as/videos, and of its query string only the ad and UTM parameters are kept), and the page title and the video's id and name are left out. The cut happens in the visitor's browser, so the full address never reaches Wexlyn. Use it where you may measure that a video was watched but not which one. - Read depth: "Read 50%" and "Read 90% of the page"
- A first-party visitor id (cookie plus local storage)
Embedded forms, surveys, calendars and checkouts
Most opt-ins happen inside an iframe: a GoHighLevel survey or form, a Calendly or Typeform embed, an embedded checkout. An iframe is a separate document with its own cookies, so on its own it would be a second visitor with none of the ad parameters the page was reached with, and the lead would look organic.
Put the script in both the page and the embedded document (GoHighLevel: Sites → Settings → Head tracking code covers pages, forms and surveys at once). The two then link up automatically: the frame asks the page for its visitor id and click parameters, adopts them, and sends no page view of its own. The opt-in inside the survey lands on the same visitor as the ad click, carrying the fbc_id, h_ad_id and the rest, so the lead is credited to the ad. In the console inside the frame you will see "Wexlyn embedded in a tracked page".
If the embedded document is one you cannot put the script in (a third-party widget), Wexlyn cannot see what happens inside it; use the tool's redirect or webhook to the page instead, with ?email={{contact.email}} on the thank-you URL.
The script respects Do Not Track and consent flags you set with window.wexlyn.consent(false).
Looking at a lead's journey and opening one of their pages? Use the Open page with tracking off link in the expanded click: it adds wexlyn=disabled to the URL and the script records nothing on that page or on any page you reach from it in the same tab. Your own visit is never attached to the person you were looking at. You can add ?wexlyn=disabled to any URL by hand for the same effect.
Live email capture
Tracking → Universal Script → Script Settings has a Live email capture choice. Live capture (the default) identifies the visitor the moment they leave an email or phone field, even if they never press the button, so a half-finished opt-in still lands in the CRM with its full journey. Only on submit reads nothing until the form is submitted or its button pressed, for businesses that need explicit consent before a lead exists (HIPAA-covered practices, for example). Under Advanced settings you can also switch email or phone capture off entirely. A saved change reaches every installed page within five minutes; nobody has to touch the tag.