google / chatbase-node

Quickly integrate your Node.js chatbot with Chatbase Analytics
Apache License 2.0
78 stars 24 forks source link

Support for link tracking #22

Open AnoopKSurendran opened 6 years ago

AnoopKSurendran commented 6 years ago

Hi, The chatebase documentation suggests on Integrate link tracking Is there any support for that

WayneChang65 commented 6 years ago

Hello, I have the same question. I've already ticked "Report the Paths for Sites" and read the document from the chatbase site. But I still don't understand what code I need to write._ Any suggestions?

NomiDomi commented 6 years ago

I have the same question! Did someone figure out how to implement this feature?

vitalets commented 5 years ago

I'm wrapping links in chatbase redirect for tracking:

  wrapUrl(url) {
      const redirUrl = new URL('https://chatbase.com/r');
      redirUrl.searchParams.set('api_key', this._apiKey);
      redirUrl.searchParams.set('url', url);
      redirUrl.searchParams.set('platform', this._getPlatform());
      redirUrl.searchParams.set('version', pkg.version);
      return redirUrl.toString();
  }