Attribute Docs

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

  1. Log into your Google Tag Manager Workspace.
  2. In the left-hand menu, select Tags -> New.
  3. Name your tag Cogwheel Attribute Tracking Script.
  4. Click Tag Configuration and select Custom HTML.
  5. 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

  1. Scroll down to Triggering.
  2. Select the built-in All Pages trigger. (The trigger type must be Page View).
  3. Click Save in the top-right corner.

Step 3: Publish

  1. Click Submit in the top-right corner of the GTM dashboard.
  2. Provide a descriptive version name (e.g., "Added Cogwheel Attribute").
  3. 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

#TestVisit this URL (your domain)Booking link should carry
1Google Adshttps://www.vanityresort.com/?gclid=test_gclid_123&utm_source=google&utm_medium=cpcYour Google Ads campaign value
2Meta Adshttps://www.vanityresort.com/?fbclid=test_fbclid_123&utm_source=facebook&utm_medium=paid_socialYour Meta Ads campaign value
3Bing Adshttps://www.vanityresort.com/?msclkid=test_msclkid_123&utm_source=bing&utm_medium=cpcYour Bing Ads campaign value
4Fallbackhttps://www.vanityresort.com/ (no parameters)Your Fallback (unpaid) campaign value

How to run a test

  1. Open a new incognito window and visit the test URL from one row of the checklist. Let the page load completely.
  2. 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.
  3. 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.
  4. Record the result in your checklist, then close the incognito window completely before the next test.
1. Open the Test URLFresh incognito window,tagged parameters2. Attribute ClassifiesTraffic type detected,matching rule fires3. Booking Link Rewrittencarries cid=<your value>on the brand domain4. Verify & RecordCheck hover preview / URL bar,log result in the checklist

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:

  1. 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 POST request to https://attribute-api.cogwheelmarketing.com/api/v1/telemetry/batch. Check the payload — it should contain a page_view event along with your detected source parameters.
    • Click the outbound booking link. A subsequent batch should include link_click and rule_applied events for the rule that matched.
  2. 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:

SymptomCauseSolution
No links are changingScript 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 changingDomain 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 rewriteNo 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 linksRule 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 anotherScript 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 landingRedirect 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 persistentCache or session storage issue.Test in a fresh Incognito window. Ensure no browser extensions block local storage or first-party cookies.

On this page