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: Enable Document Write Support
[!IMPORTANT] Beneath the HTML text editor, locate and check the box labeled Support document.write. If you omit this step, GTM may isolate the script in a sandbox, preventing the DOM observer from intercepting clicks and rewriting outbound links.
Step 3: 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 4: 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.
End-to-End Testing & QA Protocol
To guarantee attribution accuracy, follow this local validation process before launching marketing campaigns.
1. Testing Paid traffic (e.g., Google Ads)
- Open a fresh Incognito / Private Browsing window to bypass any existing cookies or storage state.
- Navigate to your vanity site using a test URL that simulates a Google Ad click:
https://www.vanityresort.com/?gclid=test_gclid_123&utm_source=google&utm_medium=cpc - Allow the page to load completely.
- Hover over your booking button (e.g., "Book Now"). Look at the bottom-left corner of the browser to view the destination URL.
- It should dynamically end with your Google Ads SCID:
&cid=PMO_YOUR_GOOGLE_SCID. - Click the link. Verify that the browser URL bar on the brand page retains the exact
cidparameter.
2. Testing Organic / Fallback traffic
- Close all active Incognito windows to clear the browser session storage.
- Open a new Incognito window.
- Navigate to your vanity site with no parameters:
https://www.vanityresort.com/ - Click the booking button.
- Once you land on the brand booking engine, verify the URL parameter contains your catch-all Organic ID:
&cid=UNP_YOUR_ORGANIC_SCID.
3. Verify Analytics & Telemetry Ingestion
Attribution is only complete when telemetry logs are recorded in your dashboard. You can QA if the script is successfully emitting events and if the rules are firing correctly:
- 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
POSTrequest tohttps://attribute-api.cogwheelmarketing.com/api/v1/telemetry. Check the payload—it should contain anevent_typeofviewalong with your detected source parameters. - Click the outbound booking link. An additional
POSTrequest (orsendBeaconrequest) should fire containing anevent_typeofclick.
- 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 page view and link click have populated the charts.
- Confirm that the Rule Activity Log at the bottom of the page registers your test action, displaying the exact rule that matched (e.g. Google Ads vs. Fallback) and the timestamp.
- Note on real-time processing: While the ingestion pipeline operates in real-time, buffering at the edge can occasionally introduce a 1 to 2-minute delay before logs appear in the dashboard charts. Allow up to 2 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 running or sandboxed. | Check GTM preview mode to verify tag is firing. Ensure Support document.write is checked in GTM configuration. |
| No links are changing | Domain not whitelisted. | Go to your Project's Settings tab. Verify the page's exact hostname is listed in Allowed Domains. |
| Wrong SCID is attached | Rule priority conflict. | Go to the Rules tab. Ensure your Organic/Fallback rule is at the bottom of the list. Drag paid ad rules to the top. |
| 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. |