Manual integration

Pre API 2.0

NotificationCenter.default.addObserver(forName: Smartlook.dashboardSessionURLChanged, object: nil, queue: nil) 
{ (note) in
  if let currentSessionUrl = Smartlook.getDashboardSessionURL(withCurrentTimestamp: false) {
 
    // process the session url change
  }
}

NotificationCenter.default.addObserver(forName: Smartlook.dashboardVisitorURLChanged, object: nil, queue: nil) 
{ (note) in
  if let currentVisitorUrlString = Smartlook.getDashboardVisitorURL()?.absoluteString {
  
    // process the user url change
  }
}

API 2.0

Use URL changes notifications to amend other tools data with the respective Smartlook links.

NotificationCenter.default.addObserver(forName: Session.urlDidChangeNotification, object: nil, queue: nil) 
{ notification in
    if let smartlook = notification.object as? Smartlook,
         let sessionUrl = smartlook.user.session.url {

        // process the URL change
  }
}

NotificationCenter.default.addObserver(forName: User.urlDidChangeNotification, object: nil, queue: nil) 
{ notification in
    if let smartlook = notification.object as? Smartlook {
    let visitorUrl = smartlook.user.url

    // process the URL change
  }
}

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: