Integrations

Manual integration

Pre API 2.0

// Registering listener
Smartlook.registerIntegrationListener(object : IntegrationListener {
    override fun onSessionReady(dashboardSessionUrl: String) {
        AnalyticsTool.trackSession(dashboardSessionUrl)
    }

    override fun onVisitorReady(dashboardVisitorUrl: String) {
        AnalyticsTool.trackVisitor(dashboardSessionUrl)
    }
})
  
// Unregistering listener
Smartlook.unregisterIntegrationListener()
// Registering listener
Smartlook.registerIntegrationListener(new IntegrationListener() {
    @Override
    public void onSessionReady(@NotNull String dashboardSessionUrl) {
        AnalyticsTool.trackSession(dashboardSessionUrl);
    }

    @Override
    public void onVisitorReady(@NotNull String dashboardVisitorUrl) {
        AnalyticsTool.trackVisitor(dashboardSessionUrl);
    }
});

// Unregistering listener
Smartlook.unregisterIntegrationListener();

API 2.0

// Register user listener
Smartlook.instance.user.listeners += object : User.Listener {
  override fun onUrlChanged(url: URL) {
    AnalyticsTool.trackUser(url)
  }
}

// Register session listener
Smartlook.instance.user.session.listeners += object : Session.Listener {
  override fun onUrlChanged(url: URL) {
    AnalyticsTool.trackSession(url)
  }
}
// Register user listener
Smartlook.getInstance().getUser().getListeners().add(url -> {
    AnalyticsTool.trackUser(url);
});

// Register session listener
Smartlook.getInstance().getUser().getSession().getListeners().add(url -> {
    AnalyticsTool.trackSession(url);
});

User listener documentation.
Session listener documentation.

Automatic integrations

Automatic integrations are no longer supported. Integration into "tools" that were supported by "automatic integrations" is described in the following documents: