Deployment & Testing (QA)
Step-by-step Google Tag Manager setup and end-to-end testing protocols
Before sending live traffic, you must properly deploy the Cogwheel Attribute script and QA the link rewriting behavior.
Google Tag Manager (GTM) Deployment
Using Google Tag Manager is the most efficient and robust method to deploy Cogwheel.
Step 1: Create the Tag
- Log into your Google Tag Manager Workspace.
- In the left-hand menu, select Tags -> New.
- Name your tag
Cogwheel Attribute Tracking Script. - Click Tag Configuration and select Custom HTML.
- Paste your integration script snippet into the HTML text area.
<script src="https://cdn.cogwheelmarketing.com/sdk.min.js"
data-project-id="YOUR_PROJECT_ID"
data-api-url="https://attribute-api.cogwheelmarketing.com"></script>Step 2: Configure the Trigger
- Scroll down to Triggering.
- Select the built-in All Pages trigger. (The trigger type must be Page View).
- Click Save in the top-right corner.
Step 3: Publish
- Click Submit in the top-right corner of the GTM dashboard.
- Provide a descriptive version name (e.g.,
"Added Cogwheel Attribute"). - Click Publish to push the script live on your site.
Expected result: after publishing, the script tag appears in the page source of your live website. If your domain is whitelisted (see Getting Started), the widget fetches your rules and starts rewriting links.
End-to-End Testing & QA Protocol
Test every rule you configured, not just one channel. Use a fresh Incognito / Private Browsing window for each test so tests do not inherit each other's tracking parameters.
Test checklist
| # | Test | Visit this URL (your domain) | Booking link should carry |
|---|---|---|---|
| 1 | Google Ads | https://www.vanityresort.com/?gclid=test_gclid_123&utm_source=google&utm_medium=cpc | Your Google Ads campaign value |
| 2 | Meta Ads | https://www.vanityresort.com/?fbclid=test_fbclid_123&utm_source=facebook&utm_medium=paid_social | Your Meta Ads campaign value |
| 3 | Bing Ads | https://www.vanityresort.com/?msclkid=test_msclkid_123&utm_source=bing&utm_medium=cpc | Your Bing Ads campaign value |
| 4 | Fallback | https://www.vanityresort.com/ (no parameters) | Your Fallback (unpaid) campaign value |
How to run a test
- Open a new incognito window and visit the test URL from one row of the checklist. Let the page load completely.
- Find your booking link. If it is a normal link (
<a href>), hover over it and check the destination preview at the bottom of the browser — it should contain the expected parameter and value. - Click through to the brand booking website and check the address bar: the URL should contain the parameter with the correct value.
- The parameter may appear as
?cid=(first parameter) or&cid=(later parameter) — both are correct.
- The parameter may appear as
- Record the result in your checklist, then close the incognito window completely before the next test.
Booking buttons: some sites use a <button> that runs booking logic instead of a plain link. These do not show a destination URL on hover — test them by clicking through and checking the final URL. If the parameter is missing, share the page with your developer: the button's redirect may need to expose its booking URL as a standard link.
Verify Analytics & Telemetry Ingestion
Attribution is only complete when telemetry logs are recorded in your dashboard. You can QA that the script is emitting events and that rules are firing:
- Network Logs Verification:
- Open your browser's Developer Tools (Right-click -> Inspect, or press
F12) and select the Network tab. - Filter the network requests by typing
telemetry. - Load your vanity website. You should see a batched
POSTrequest tohttps://attribute-api.cogwheelmarketing.com/api/v1/telemetry/batch. Check the payload — it should contain apage_viewevent along with your detected source parameters. - Click the outbound booking link. A subsequent batch should include
link_clickandrule_appliedevents for the rule that matched.
- Open your browser's Developer Tools (Right-click -> Inspect, or press
- Dashboard Verification:
- Open your Cogwheel Attribute dashboard and navigate to the Analytics tab.
- Verify that your session, page view, and rules-fired counts have incremented.
- Confirm the rule appears in the Top Rules table with its executions counted (e.g., Google Ads vs. Fallback).
- Note on real-time processing: While the ingestion pipeline operates in real-time, buffering at the edge can occasionally introduce a short delay before events appear in the dashboard charts. Allow a couple of minutes during QA checks.
Troubleshooting Guide
If links are not rewriting as expected, check the following common issues:
| Symptom | Cause | Solution |
|---|---|---|
| No links are changing | Script not installed or not loading. | View page source for the sdk.min.js script tag; verify the tag is firing in GTM Preview mode. |
| No links are changing | Domain not whitelisted. | Go to your Project's Settings tab. If the Domain Whitelist has entries, verify the page's exact hostname (including www.) is listed. |
| Script loads but links never rewrite | No active rules, or rules saved without a campaign value. | Go to the Rules tab. Confirm each rule's Status toggle is active and Campaign Value is filled. |
| Wrong campaign value on links | Rule set up for the wrong traffic type or brand. | Go to the Rules tab. Confirm the Traffic Type and Hotel Brand on each row; remove duplicate rows for the same combination. |
| Works on one page but not another | Script only on some pages. | Confirm the GTM tag fires on All Pages, or that the snippet is in the site-wide template. |
Brand URL does not keep cid after landing | Redirect controlled by the brand. | Check the URL immediately after leaving your site; the brand controls any further redirects on its own domain. |
| Click ID not persistent | Cache or session storage issue. | Test in a fresh Incognito window. Ensure no browser extensions block local storage or first-party cookies. |