company logo

Help center

All collectionsKTag Data CollectionImplementing the Knotch KTag on Your Site

Implementing the Knotch KTag on Your Site

Follow this step-by-step guide to implement the KTag for real-time data collection on your website.

1. What is KTag?

KTag is the lightweight JavaScript tag that powers data collection for Knotch. It auto-collects and sends event-level data—e.g. page views, scroll depth, time-on-page, clicks, source metadata, etc.—to Knotch in real time.


2. Your Account ID

Each account will receive a unique public account ID to be associated with the KTag request.
This account ID is unique for each KTag implementation, and is not the same ID that other Knotch products use.

Note: The script shown below in Step 5 is just an example. This is not your KTag script. Your Knotch Customer Representative will send you your unique KTag script.


3. Domain Allow-List (“Whitelist”)

To protect your data—and your visitors—we only accept traffic from domains you explicitly approve. Until we receive and add the allow-list URLs, no data will be collected and stored by KTag.

What you need to do

What happens

Send us each root domain you plan to instrument (e.g., yourdomain.com, yourotherdomain.com).

We add the domain to your allow-list. All sub-domains (e.g., *.knotch.com, blog.yourdomain.co.uk) begin sending data automatically.

Whitelisting knotch.com enables capture on every sub-domain — insights.knotch.com, partners.knotch.com, and any future sub-domain—without extra configuration.

Need to add more later?
Email your Knotch Customer Service representative.


4. Domain Block-List (“Blacklist”) – Optional

Occasionally you may wish to exclude certain areas—internal tools, employee portals, or privacy-sensitive paths—from tracking.

What you need to do

What happens

Provide the sub-domains or path patterns you want to exclude (e.g., admin.brand.com, /private/*).

We add them to your block-list.

Note: The block-list overrides the allow-list.


5. Adding the Tag

Place one script tag inside the <head> of every page you wish to measure—either directly in your template (e.g., header.html) or through a tag manager such as Google Tag Manager or Adobe Launch.

Tip: If using a tag manager, set the trigger to “All Pages” so the tag fires consistently.

Example Tag

(Your Knotch Customer Representative will provide your unique account-specific version.)

EXAMPLE TAG (Your Knotch Customer representative will provide you with your unique account Ktag)

<!-- Knotch KTag -->
<script async src="https://www.knotch-cdn.com/ktag/latest/ktag.min.js?accountId=YOUR_ACCOUNT_ID"></script>


6. Activation Timeline

Step

Action

Owner

1

Deploy KTag to your site.

Customer (you)

2

Submit root domains for allow-listing (as well as optional block-listing) to your CSM (see Points 3 & 4 above).

Customer (you)

3

Allow-list (and block-list if needed) confirmed and implemented by Knotch.

Knotch

4

Data starts flowing – KTag begins collecting and queuing events in real time.

Automated

5

QA – We will verify event flow to confirm the KTag has been successfully deployed.

Knotch

Note: Step 4 is when we will start receiving data. It is important to note that until the allow-list domains are added and confirmed, no data will be collected or stored.


7. Need Help?

Contact your Knotch Customer Success Manager for assistance with:

  • Verifying that domains are correctly allow-listed or block-listed

  • Adding new properties during acquisitions or rebrands

  • Testing in lower environments without polluting production data