Events

Logging events in SaaSInsights.ai

You can send events through the JavaScript SDK. The SDK can be loaded from www.saasinsights.io/saasinsights.js or locally from your Docker image from YOURDOMAIN.com/js/saasinsights.js.

SaaSInsights.init({baseUrl: MY_DOMAIN, saasInsightsAccountId: SAASINSIGHTS_ACCOUNT_ID, accountId: ACCOUNT_ID, userId: USER_ID).
                .track(event_string, properties)

baseUrl - This is the base path to where the application can be hosted. If you host the app on saasinsights.mydomain.com then the base URL would be "https://saasinsights.mydomain.com/api/v1/". saasInsightsAccountId - The ID of your Saas Insights account App. You can find it on the Get Started Page page in the SaaSInsights dashboard.

account_id - This is your internal ID for the account browsing the app/site

User_id - The ID of the user who is browsing the app. This is your internal User ID

event_string - This is the name of the event you want to track. properties - this is an object where you can pass data such as quantity, cost etc. The format in these two examples are {cost: 100, quantity 1}

Last updated

Was this helpful?