You know which campaign ran. You don't know which one converted.
You run paid campaigns on Google, Meta, and email. Every link carries UTM parameters. The traffic lands, the user signs up or buys, and then you look at your CRM and there is nothing: no source, no medium, no campaign name. The signup form did not capture any of it.
Google Analytics shows you aggregate channel data. It won't tell you that this WooCommerce customer came from that cold-email sequence. Without row-level attribution, your budget decisions are guesswork dressed up in charts.
What most people do
A better way: capture, read, clean
TrueCommander stores attribution server-side the moment a visitor arrives with UTM parameters. Run enable utm tracking as a startup command and every frontend page load checks the URL. If UTM parameters are present, they land in the trc_utms table and a 30-day cookie ties that visitor to their row. Later, inside any macro, get user utm reads it back. When your history grows too large, clear utm prunes records older than a date you pick.
Branch cleanly on has_utm. When get user utm runs and the cookie is absent or points to a pruned row, it returns has_utm: false. Your macro can check that flag and skip the CRM push entirely, so you never send a half-empty record downstream.
What each command does
Three commands, one job: capture the campaign that brought each visitor, read it inside your automation, and keep the table tidy over time.
| Command | What it does |
|---|---|
enable utm tracking | Registers a hook that runs on every frontend page load. When UTM parameters are present in the URL, they are written to the trc_utms table and a trc_utm_id cookie (30-day TTL) is set, linking the visitor to their attribution row. Save it as a Startup Command so the hook is active on every visit. |
get user utm | Reads the current visitor's UTM attribution by looking up the trc_utm_id cookie. Use -tags to narrow to specific fields (CSV), or omit it to return all five. Returns a has_utm flag you can branch on in a macro before passing data to a CRM or webhook. |
clear utm | Deletes rows from trc_utms with a visit_time strictly before the date you pass to -till. Run it on a schedule to keep the table from growing unbounded. Rows on or after the date are untouched. |
How it works
enable utm tracking Save it as a Startup Command once. On every subsequent frontend page load, TrueCommander checks the URL for UTM parameters and writes any new combination to trc_utms, setting a 30-day trc_utm_id cookie on the visitor's browser.get user utm When a visitor converts (signs up, buys, submits a form), your macro calls get user utm, gets their source and campaign back, checks has_utm, and sends the data to your CRM or webhook in the next step.clear utm Schedule tp clear utm -till=YYYY-MM-DD monthly. The table stays lean, queries stay fast, and you only lose attribution history older than your chosen cutoff.Command parameters
| Detail | Value |
|---|---|
| Command names | enable utm tracking, get user utm, clear utm |
get user utm param: -tags | CSV of UTM field names to return. Accepted values: utm_source, utm_medium, utm_campaign, utm_term, utm_content. Omit to return all five. |
clear utm param: -till | Required. Date in YYYY-MM-DD format. Rows with visit_time strictly before this date are deleted. Example: -till=2026-03-20 removes everything before 20 March 2026. |
| Cookie name | trc_utm_id · 30-day TTL · set on the visitor's browser at capture time |
| Storage table | trc_utms. Each unique UTM combination creates a new row. Cookie points to the visitor's row. |
has_utm flag | false when the cookie is absent or points to a row that has been pruned. Use it to skip downstream CRM steps cleanly. |
| Can be used in |
Real example
Your marketing team runs a Google Ads campaign called spring-sale-2026 and an email sequence tagged utm_source=email. Both drive traffic to the same WooCommerce product page.
You run enable utm tracking once and save it as a Startup Command. From that point on, every visitor who lands with UTM parameters gets a row in trc_utms and a cookie. When a visitor completes checkout, a macro fires: step one calls tp get user utm -tags=utm_source,utm_campaign, step two checks has_utm, and step three calls send api to POST the order ID and attribution straight into your CRM.
Two weeks later the team looks at closed deals in the CRM and sees exactly which campaign drove each signup. The paid search campaign drove three times the revenue of the email sequence at half the volume. Budget shifts accordingly. No analytics plugin touched any of this.
Goes further with TrueCommander
enable utm tracking to the Startups module and the hook is live on every frontend page load from that moment on, with no code deployed and nothing to maintain.get user utm, branch on has_utm, then call send api to POST the source and campaign to your CRM alongside the order or lead record.clear utm Set a monthly schedule to run tp clear utm -till=YYYY-MM-DD. Attribution history stays within the window you care about and the table never becomes a performance liability.