How to integrate Fibotalk in Angular app?

Published by Shivam Kumar on

Embedding the JS code

Integrating Fibotalk analytics in an angular app is very easy and requires no more than 15-20 mins.

To start tracking with Fibotalk, copy the JS code that is provided in the “Install on Website” option in the “Messenger settings” in the “Chats” menu, into the <head> and </head> tags of “index.html” file of the app.

The code can be found at

To use Fibotalk tracking, declare a global variable(After all import statements) in the desired component/service in which tracking needs to be done.


Signup Event

Signup tracking is done the same way as login tracking. In the signup module, just put
two lines of code after successful signup along with user information data object.


Login Event

Put the below two lines of code at the appropriate place in the login module to capture the
login event after successful login with the desired user information data object


User identification

User is identified with our Login and Signup APIs automatically. However, if a user
can be identified by the application outside of login and Signup events, it can be done
in the following way.

User data can be set/updated in Fibotalk whenever there is a requirement for the

Call the setUserInfo method with an object containing the user information as parameter.
User information object can have a various field which defines the user’s attributes.
Sample userInfo object is


.Custom Event Tracking

To track custom event there is a function “setEvent()”. This function is used for
deeper integrations like
– API latency analysis
– A workflow inside a feature etc.
– Track toggle events
– Start and Stop of certain functions in the application like Video viewing, form
filling etc.
Details of the setEvent function

Function Arguments

  1. event_name <string>:  This can be any name. No special characters are supported except underscore and hyphen. There is a limitation of 50 characters for the name of the event. Once the events are triggered from the App they would be visible in the dropdown in analytics filters.
  2. event_value <string/number>:  There might be certain events that would need to have a value. For example, if you would like to track the “API-Failure” event in your system, you would like to have a value of “response code” or message to make more sense of value. This value can be number or string but not objects or Arrays.
  3. custom_parameters <JSON object>: In certain situations when the values needed to be passed are complex objects, you can use the custom parameters to pass the value.

Examples :

Testing the Implementation

Login to and select the account for which the code is
embedded in your application.
You can instantly see the website analytics. Custom Dashboards can be created.
Please write to us for more help at

Leave a Reply

Your email address will not be published. Required fields are marked *