Search

Personal Links

APIs

slack button (do not delete)

Add a Knock Chat button inside your product

Add a Knock Chat button inside your product

Add a Knock Chat button inside your product

Turn high-intent moments inside your product into conversations with your team.

For product-led companies, buyers often show their strongest intent while they are actually using the product.

They may reach an upgrade point, explore an enterprise feature, hit a limitation, or want to understand pricing.

Instead of sending them to a separate Contact Sales page, you can add a Knock chat button directly inside your product.

For example:

  • Discuss pricing
  • Talk to Sales
  • Upgrade with us
  • Talk about Enterprise
  • Need help with this feature?

Because the user is already logged in, your product already knows who they are. You can identify them in Knock and carry that identity with them when they open a Knock chat.

How it works

The flow is:

User signs in → identify them with Knock → user reaches a buying moment → clicks your CTA → open the wrapped Knock chat link

The Knock tag must already be installed on your product.

1. Identify logged-in users

Once you know who the user is, identify them with Knock:

function knockIdentify(traits) {
  if (window.Knock) {
    window.Knock.identify(traits);
  } else {
    window.addEventListener(
      'knock:ready',
      () => window.Knock.identify(traits),
      { once: true }
    );
  }
}

Then pass the information you already know:

knockIdentify({
  email: user.email,
  firstName: user.firstName,
  lastName: user.lastName,
});

You can also include additional traits that are useful to you:

knockIdentify({
  email: user.email,
  firstName: user.firstName,
  lastName: user.lastName,
  company: user.company,
  plan: user.plan,
});

2. Add Knock to high-intent product moments

Place your Knock CTA wherever users are likely to want a conversation.

For example:

Pricing or upgrade

A user reaches a feature that requires a higher plan:

Want access? Talk to Sales

Enterprise feature

A user explores functionality available only to enterprise customers:

Discuss Enterprise

Product evaluation

A buyer is actively testing your product and needs help understanding whether it fits their use case:

Talk to our team

Complex setup

A user reaches a step where a conversation would help:

Get help from our team

3. Wrap the Knock chat link

Before sending the user to your Knock chat destination, wrap the URL:

function knockWrapLink(url) {
  if (window.Knock) {
    return window.Knock.wrapLink(url);
  }

  return url;
}

Then use the wrapped URL for your CTA.

document.getElementById('talk-to-sales').href =
  knockWrapLink(knockChatUrl);

Or navigate when the user clicks:

window.location.href = knockWrapLink(knockChatUrl);

Or open the conversation in a new tab:

window.open(knockWrapLink(knockChatUrl), '_blank');

Wrapping the link attaches Knock's visitor ID so the Knock destination is connected to the same person.

Putting it together

Identify the user once your product knows who they are:

knockIdentify({
  email: user.email,
  firstName: user.firstName,
  lastName: user.lastName,
});

Then, when they reach a high-intent moment:

window.location.href = knockWrapLink(knockChatUrl);

This lets the user's journey continue from your product into Knock without treating the Knock destination as an unrelated new session.

Create a more continuous buyer experience

The value of identifying users is not just avoiding another identity step.

It helps Knock connect the person using your product with the same visitor identity used across their Knock experience.

That means you can create a more continuous experience as buyers move between your website, your product, and Knock destinations.

Instead of:

Visit website → sign up → use product → click Contact Sales → start over

you can create:

Visit → sign up → use product → start a conversation

The buyer can move into a conversation at the moment they are ready to talk.

Which links should I wrap?

Wrap Knock destinations, including:

  • Knock chat links
  • Knock Slack links
  • Knock meeting links

Do not wrap links to your own application or unrelated third parties.

For the complete implementation details, see Identifying leads and wrapping Knock links.