Rule Engine & Templates
How sessions are classified into traffic types and how the Attribution Matrix rewrites brand links
The Cogwheel Attribute Rule Engine classifies each visitor session into a traffic type and dynamically rewrites links, inputs, and DOM attributes as the visitor browses your site.
How the Rule Engine Works
When a visitor lands on your vanity website, the Cogwheel script captures their attribution parameters (UTMs, referrer, click IDs) and stores them for the duration of their session (30 minutes of inactivity).
- The script classifies the session into exactly one traffic type — for example
google_ads_session,meta_ads_session,bing_ads_session, orfallback_session(see the condition field reference below for the exact matching rules). - When the visitor hovers over, clicks, or submits a form targeting a brand booking domain (e.g.,
marriott.com), the script checks your Attribution Matrix for a row whose Traffic Type matches the session and whose Target Domain matches the link. - Each matching row applies its action: appending the brand parameter with your Campaign Value (e.g.,
cid=PMO_...), and injecting the same value into booking form fields.
Because the standard traffic types are mutually exclusive, a session matches at most one paid preset — so a typical setup of one row per traffic type per brand produces exactly one value per parameter.
Avoid creating duplicate rows for the same Traffic Type and Hotel Brand. When two matching rules write the same parameter, the rule evaluated later overwrites the earlier value.

Configuring the Attribution Matrix
The Rules tab shows the Attribution Matrix — one row per Traffic Type and Hotel Brand combination. You only supply the Campaign Value; everything else is derived from the preset you pick.
Option A: Pre-populate the standard matrix
Click Pre-populate Standard Hotel Matrix to create rows for the standard traffic types across the Marriott, Hilton, and Hyatt presets. Then click the pencil (edit) icon on each row you need, paste the campaign code into Campaign Value, and save. Delete the rows you do not need (trash icon).
Option B: Add rows manually
- Click Add Attribution Rule — a new editable row appears at the bottom of the matrix.
- Pick the Traffic Type (e.g., Google Ads).
- Pick the Hotel Brand (e.g., Marriott). The Target Domain and Param Name fill in automatically.
- Paste your campaign code into Campaign Value.
- Confirm the Status toggle is active, then save the row.
Repeat for each traffic type you track. A typical Marriott property has Google Ads, Facebook Ads, and Fallback rows.
Matrix columns
| Column | Meaning |
|---|---|
| Traffic Type | The visitor channel the rule matches (Google Ads, Facebook Ads, Bing Ads, TikTok Ads, LinkedIn Ads, Twitter Ads, Reddit Ads, Fallback) |
| Hotel Brand | The brand preset whose booking domain the rule targets |
| Target Domain | The brand domain whose links get rewritten (auto-filled, e.g. marriott.com) |
| Param Name | The URL parameter Attribute appends (auto-filled, e.g. cid) |
| Campaign Value | Your campaign code — the only value you supply |
| Status | Toggle the rule active or inactive. Inactive rules never match. |
Brand Rule Templates
The traffic-type presets check for both platform click IDs and standard UTM tagging, so they match real-world traffic even when a click ID is missing.
Google Ads
- Matches sessions with
gclid,gad_source,gbraid, orwbraid— orutm_source=google-style tagging with a paid medium such ascpc. - Marriott action: appends
cidwith your Google AdsPMO_code.
Meta Ads (Facebook & Instagram)
- Matches sessions with
fbclid,cft, origshid— orutm_source=facebook/instagram/igtagging with a paid medium. - Marriott action: appends
cidwith your Meta AdsPMO_code.
Microsoft/Bing Ads
- Matches sessions with
msclkid— orutm_source=bingtagging with a paid medium. - Marriott action: appends
cidwith your Bing AdsPMO_code.
Fallback (Unpaid / Catch-All)
- Matches every session that no paid preset recognized — direct visits, organic search, referrals, email links, untagged social posts, and any mistagged campaigns.
- Marriott action: appends
cidwith your unpaidUNP_code.
Fallback is not just "organic and direct." It is the safety net for all unmatched traffic, which is why its Campaign Value should be your unpaid (UNP_) code: visitors who arrive without recognizable paid tags still carry a valid tracking code instead of none.
Custom Brands & Parameters
If you use a booking engine outside the built-in presets, choose Custom in the Hotel Brand column. This unlocks the Target Domain and Param Name fields so you can target any domain with any parameter — for example book.vanityresort.com with the parameter aff_id.
Reference: Condition Fields & Brand Mappings
Traffic Source Condition Fields
Each Traffic Type row maps to one of these session classifiers:
| Condition Field | Matches Session When... |
|---|---|
google_ads_session | Landing URL contains gclid, gad_source, gbraid, wbraid, dclid, or utm_source matches google/google-ads/googleads/adwords + utm_medium matches cpc/ppc/paid/ads/ad/paidsearch. |
meta_ads_session | Landing URL contains fbclid, cft, igshid, or utm_source matches facebook/instagram/ig/messenger/meta/fb + utm_medium matches cpc/ppc/ads/paid/paid_social/paidsocial/paid-social/social-ads/social_ads. |
bing_ads_session | Landing URL contains msclkid or utm_source matches bing/bingads/bing-ads/microsoft/msn + utm_medium matches cpc/ppc/ads/paid/paidsearch/ad. |
tiktok_ads_session | Landing URL contains ttclid or utm_source containing tiktok / matching tt + utm_medium matches CPC/Paid/Paid Social. |
linkedin_ads_session | Landing URL contains li_fat_id or utm_source containing linkedin / matching lnkd + utm_medium matches CPC/Paid/Paid Social. |
twitter_ads_session | Landing URL contains twclid or utm_source containing twitter / matching x / t.co + utm_medium matches CPC/Paid/Paid Social. |
reddit_ads_session | Landing URL contains rdt_cid or utm_source containing reddit + utm_medium matches CPC/Paid/Paid Social. |
unpaid_referrer | Landing URL contains no paid click IDs, and the UTM medium does not indicate CPC or paid search/social. |
fallback_session | Catch-all for any session that does not match any paid search/social presets. |
Hotel Brand Parameters
The application features native presets to map rules to specific booking domains. Outbound links targeting these domains automatically receive the associated parameter name:
- Marriott: Targets
marriott.comusing parametercid(typically carrying a Marriott campaign code — historically called an SCID, now issued as a CID in Growth OS). - Hilton: Targets
hilton.comusing parameterWT.mc_id. - Hyatt: Targets
hyatt.comusing parametersrc(typically carrying a concatenated Hyatt source code). - IHG: Targets
ihg.comusing parametercm_mmc. - Wyndham: Targets
wyndhamhotels.comusing parameterCID. - Choice: Targets
choicehotels.comusing parametermc.