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: 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

  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 4: 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.

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)

  1. Open a fresh Incognito / Private Browsing window to bypass any existing cookies or storage state.
  2. 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
  3. Allow the page to load completely.
  4. Hover over your booking button (e.g., "Book Now"). Look at the bottom-left corner of the browser to view the destination URL.
  5. It should dynamically end with your Google Ads SCID: &cid=PMO_YOUR_GOOGLE_SCID.
  6. Click the link. Verify that the browser URL bar on the brand page retains the exact cid parameter.

2. Testing Organic / Fallback traffic

  1. Close all active Incognito windows to clear the browser session storage.
  2. Open a new Incognito window.
  3. Navigate to your vanity site with no parameters:
    https://www.vanityresort.com/
  4. Click the booking button.
  5. 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:

  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 POST request to https://attribute-api.cogwheelmarketing.com/api/v1/telemetry. Check the payload—it should contain an event_type of view along with your detected source parameters.
    • Click the outbound booking link. An additional POST request (or sendBeacon request) should fire containing an event_type of click.
  2. 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:

SymptomCauseSolution
No links are changingScript 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 changingDomain not whitelisted.Go to your Project's Settings tab. Verify the page's exact hostname is listed in Allowed Domains.
Wrong SCID is attachedRule 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 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