### List Events Example Source: https://integrations.smartlook.com/docs/api-overview This example demonstrates how to list events for your project using the Smartlook API. Replace `` with your actual API token. ```APIDOC ## GET /api/v1/events ### Description Retrieves a list of events recorded in your Smartlook project. ### Method GET ### Endpoint `https://api..smartlook.cloud/api/v1/events` ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of results to return per page. - **after** (string) - Optional - A cursor for fetching the next page of results. - **before** (string) - Optional - A cursor for fetching the previous page of results. ### Request Example ```bash curl -X GET \ https://api.eu.smartlook.cloud/api/v1/events \ -H 'authorization: Bearer ' \ -H 'cache-control: no-cache' ``` ### Response #### Success Response (200) - **data** (array) - An array of event objects. - **pagination** (object) - Contains `before` and `after` cursors for pagination. - **_links** (object) - Contains links to `nextPage` and `previousPage`. #### Response Example ```json { "data": [ { "id": "event-id-1", "name": "button_click", "timestamp": "2023-10-27T10:00:00Z" }, { "id": "event-id-2", "name": "page_view", "timestamp": "2023-10-27T10:05:00Z" } ], "pagination": { "before": "MTaxX34=", "after": "HellOW0rLD" }, "_links": { "nextPage": "/api/events?after=HellOW0rLD&limit=10", "previousPage": "/api/events?before=MTaxX34=&limit=10" } } ``` ``` -------------------------------- ### List Project Events Source: https://integrations.smartlook.com/docs/api-overview Example of how to list events for your project using curl. Ensure you replace `` with your actual API token. ```bash curl -X GET \ https://api.eu.smartlook.cloud/api/v1/events \ -H 'authorization: Bearer ' \ -H 'cache-control: no-cache' ``` -------------------------------- ### Setup Alerts Webhook Source: https://integrations.smartlook.com/docs/alerts-webhook Use this endpoint to configure a new webhook that will receive alerts. You can optionally provide a secret for request signature verification. ```APIDOC ## POST /api/v1/webhooks ### Description Sets up a webhook to receive alerts when anomalies are detected. ### Method POST ### Endpoint /api/v1/webhooks ### Parameters #### Request Body - **url** (string) - Required - The URL where the webhook will send notifications. - **type** (string) - Required - Must be set to "alerts" for alert webhooks. - **secret** (string) - Optional - A secret key used for signing webhook requests. ``` -------------------------------- ### Shares Webhook Payload Example Source: https://integrations.smartlook.com/docs/shares-webhook This is an example of the JSON payload structure you will receive when a 'shares' event occurs. ```APIDOC ## Shares Webhook Payload ### Description Example payload structure for shares webhook events. ### Response Example ```json { "type": "shares.share" | "shares.unshare", "timestamp": Date, "project": { "id": String, "name": String }, "organization": { "id": String, "name": String }, "data": { "session": { "id": String, "url": String } } } ``` ``` -------------------------------- ### Example Shares Webhook Payload Source: https://integrations.smartlook.com/docs/shares-webhook This is an example of the JSON payload structure you will receive when a shares webhook is triggered. It includes event type, timestamp, project, organization, and session details. ```json { "type": "shares.share" | "shares.unshare", "timestamp": Date, "project": { "id": String, "name": String }, "organization": { "id": String, "name": String }, "data": { "session": { "id": String, "url": String } } } ``` -------------------------------- ### Heatmaps Webhook Payload Example Source: https://integrations.smartlook.com/docs/heatmaps-webhook An example of the JSON payload structure that will be sent to your registered webhook URL when a heatmap is finished. ```APIDOC ## Heatmaps Finished Payload ### Description This is an example of the data structure received when a heatmap process is completed. ### Response Example ```json { "type": "heatmaps.finished", "timestamp": "Date", "project": { "id": "String", "name": "String" }, "organization": { "id": "String", "name": "String" }, "data": { "heatmap": { "id": "String", "name": "String", "url": "String" }, "views": { "limit": Number, "total": Number, "mobile": Number, "tablet": Number, "desktop": Number }, "finishedAt": "Date" } } ``` ``` -------------------------------- ### TypeScript: Track Smartlook URLs with Mixpanel Source: https://integrations.smartlook.com/docs/mobile-integrations-mixpanel Integrate Smartlook with Mixpanel using TypeScript. This example shows how to register listeners for user and session URL changes and send events to Mixpanel. ```typescript function sessionUrlChangedCallback(sessionUrl: string) { mixpanel.track( "Smartlook session URL", {"session_url": sessionUrl}); } function userUrlChangedCallback(userUrl: string) { mixpanel.people.set({ "smartlook_user_url": userUrl }); // identify must be called along with every instance of people.set mixpanel.identify("sample_identifier"); } Smartlook.instance.eventListeners.registerUserChangedListener(userUrlChangedCallback); Smartlook.instance.eventListeners.registerSessionChangedListener(sessionUrlChangedCallback); ``` -------------------------------- ### Example Alerts Webhook Response Source: https://integrations.smartlook.com/docs/alerts-webhook This is an example of the JSON payload received when an anomaly triggers an alert. It includes details about the project, organization, and the specific anomaly data. ```json { "type": "alerts.", "timestamp": Date, "project": { "id": String, "name": String }, "organization": { "id": String, "name": String }, "data": { "target": { "name": String, "type": "event" | "funnel", "id": String, "url": String }, "direction": String, "threshold": Number, "value": Number, "date": Date } } ``` -------------------------------- ### Register Smartlook Integration Listener (Dart) Source: https://integrations.smartlook.com/docs/mobile-integrations-bugsnag Implement a custom integration listener in Dart to handle Smartlook session and visitor readiness. This example shows how to set Bugsnag user details when a visitor is ready. ```dart class CustomIntegrationListener implements IntegrationListener { @override void onSessionReady(String? dashboardSessionUrl) { //todo add tracking of sessions } @override void onVisitorReady(String? dashboardVisitorUrl) { bugsnag.setUser(id: dashboardVisitorUrl, email: 'bugs.nag@bugsnag.com', name: 'Bugs Nag'); } } //Put to your init state or some place you want to register this Smartlook.registerIntegrationListener(CustomIntegrationListener()); ``` -------------------------------- ### Issues Webhook Payload Example Source: https://integrations.smartlook.com/docs/issues-webhook This is an example of the JSON payload received when an issues webhook is triggered. It contains details about the event, project, organization, and the issue data itself. ```json { "type": "issues.created", "timestamp": Date, "project": { "id": String, "name": String }, "organization": { "id": String, "name": String }, "data": { "author": { "name": String, "email": String }, "visitor": { "id": String }, "session": { "id": String, "url": String }, "summary": String, "text": String, "time": Number, "createdAt": Date } } ``` -------------------------------- ### Find Users Dropped Off Before Step 4 Source: https://integrations.smartlook.com/docs/searching-funnels-for-drop-off-users This GET request specifically targets users who continued to step 3 but dropped off before completing step 4. It requires a date range, the target step, and `success=false`. ```http GET https://api.eu.smartlook.cloud/api/v1/funnels//visitors/drop-off?dateFrom=2023-06-10&dateTo=2023-06-13&step=4&success=false ``` -------------------------------- ### Custom Smartlook Integration Listener in Dart Source: https://integrations.smartlook.com/docs/mobile-integrations-heap Implement a custom integration listener in Dart to track Smartlook session and visitor URLs with Heap. This example shows how to send session URLs as events and visitor URLs as user properties. ```dart class CustomIntegrationListener implements IntegrationListener { @override void onSessionReady(String? dashboardSessionUrl) { heap.track( identity: _identity, event: 'dashboardSessionUrl', properties: { 'dashboardSessionUrl': dashboardSessionUrl }, ); } @override void onVisitorReady(String? dashboardVisitorUrl) { heap.userProperties( identity: _identity, properties: { 'dashboardVisitorUrl': dashboardVisitorUrl }, ); } } //Put to your init state or some place you want to register this Smartlook.registerIntegrationListener(CustomIntegrationListener()); ``` -------------------------------- ### Notes Webhook Event Payload Source: https://integrations.smartlook.com/docs/notes-webhook This is an example of the JSON payload structure that will be sent to your registered webhook URL when a note is created or updated. ```APIDOC ## Notes Webhook Event Payload ### Description This is an example of the JSON payload structure that will be sent to your registered webhook URL when a note is created or updated. ### Response Example ```json { "type": "notes.created" | "notes.updated", "timestamp": Date, "project": { "id": String, "name": String }, "organization": { "id": String, "name": String }, "data": { "id": String, "author": { "name": String, "email": String }, "noteType": "session", "createdAt": Date, "updatedAt": null | Date, // notes.created | notes.updated "text": String, "visitor": { "id": String }, "session": { "id": String, "url": String }, "time": Number, "commentsCount": Number, "parentNote": { "id": String, "author": { "name": String, "email": String }, "noteType": "session", "createdAt": Date, "updatedAt": null | Date, "text": String, "visitor": { "id": String }, "session": { "id": String, "url": String }, "time": Number, "commentsCount": Number } | null } } ``` ``` -------------------------------- ### Add Smartlook Session URL to Bugsnag Errors (TypeScript) Source: https://integrations.smartlook.com/docs/mobile-integrations-bugsnag This TypeScript example shows how to register a listener to capture Smartlook session URLs and add them to Bugsnag error events. Ensure Smartlook is initialized. ```typescript Bugsnag.start({ onError: function (event) { Smartlook.instance.eventListeners.registerSessionChangedListener( function (sessionUrl) { event.addMetadata('Smartlook', {"Dashboard session URL": sessionUrl}); }); } }); ``` -------------------------------- ### Search Funnel Drop-off Users Source: https://integrations.smartlook.com/docs/searching-funnels-for-drop-off-users Use a GET request to find users who dropped off before a specified step. Parameters include date range, funnel step, and success status. ```http GET https://api.eu.smartlook.cloud/api/v1/funnels//visitors/drop-off?dateFrom=2023-06-10&dateTo=2023-06-13&step=1&success=true ``` -------------------------------- ### Find Users Who Completed Step 4 Source: https://integrations.smartlook.com/docs/searching-funnels-for-drop-off-users This GET request retrieves users who successfully completed step 4 of the funnel within the specified date range. It uses `success=true` to filter for completed steps. ```http GET https://api.eu.smartlook.cloud/api/v1/funnels//visitors/drop-off?dateFrom=2023-06-10&dateTo=2023-06-13&step=4&success=true ``` -------------------------------- ### Set up Notes Webhook Source: https://integrations.smartlook.com/docs/notes-webhook Use this POST request to set up a webhook for receiving notes events. The 'url' is where the webhook will send data, 'type' must be 'notes', and 'secret' is optional for payload verification. ```bash POST /api/v1/webhooks BODY: { "url": "https://some-url.com", "type": "notes", "secret": "a-secret" //optional } ``` -------------------------------- ### Set up Shares Webhook Source: https://integrations.smartlook.com/docs/shares-webhook Use this endpoint to register a webhook for shares events. The secret is optional but recommended for verifying webhook authenticity. ```bash POST /api/v1/webhooks BODY: { "url": "https://some-url.com", "type": "shares", "secret": "some-secret" //optional } ``` -------------------------------- ### Set up Alerts Webhook Source: https://integrations.smartlook.com/docs/alerts-webhook Use this endpoint to register a webhook for receiving alerts. Specify the URL, set the type to 'alerts', and optionally provide a secret for signature verification. ```bash POST /api/v1/webhooks BODY: { "url": "https://some-url.com", "type": "alerts", "secret": "some-secret" //optional } ``` -------------------------------- ### Setting up Shares Webhook Source: https://integrations.smartlook.com/docs/shares-webhook Use this endpoint to register a new webhook for 'shares' events. You can optionally provide a secret for signature verification. ```APIDOC ## POST /api/v1/webhooks ### Description Registers a new webhook for 'shares' events. ### Method POST ### Endpoint /api/v1/webhooks ### Parameters #### Request Body - **url** (string) - Required - The URL where the webhook payload will be sent. - **type** (string) - Required - Must be set to "shares" for this webhook. - **secret** (string) - Optional - A secret key used for signing webhook payloads. ``` -------------------------------- ### Set up Dashboards Webhook Source: https://integrations.smartlook.com/docs/dashboards-webhook Use this POST request to register a webhook for dashboard reports. The 'secret' field is optional. ```bash POST /api/v1/webhooks BODY: { "url": "https://some-url.com", "type": "dashboards", "secret": "some-secret" //optional } ``` -------------------------------- ### Set up Issues Webhook Source: https://integrations.smartlook.com/docs/issues-webhook Use this endpoint to register a webhook for issues. The `secret` is optional and can be used for signature verification. ```bash POST /api/v1/webhooks BODY: { "url": "https://some-url.com", "type": "issues", "secret": "some-secret" //optional } ``` -------------------------------- ### Example Dashboards Webhook Payload Source: https://integrations.smartlook.com/docs/dashboards-webhook This JSON structure represents the data received when a dashboards report is finished. It includes details about the project, organization, and the report itself. ```json { "type": "dashboards.report", "timestamp": Date, "project": { "id": String, "name": String }, "organization": { "id": String, "name": String }, "data": { "dashboardId": String, "reportSchedule": "day" | "week" | "month", "url": String, "pdfUrl": String } } ``` -------------------------------- ### Delete Visitors Module Configuration Source: https://integrations.smartlook.com/docs/deleting-users This configuration snippet shows how to set up the 'smartlook:deleteVisitors' module in make.com. It maps visitor UIDs from a previous step to the delete action. Ensure the connection is correctly set up. ```json { "id": 3, "module": "smartlook:deleteVisitors", "version": 1, "parameters": { "__IMTCONN__": 1103343 }, "mapper": { "uids": "{{map(2.array; 0; )}}" }, "metadata": { "designer": { "x": 600, "y": 0 }, "restore": { "parameters": { "__IMTCONN__": { "label": "", "data": { "scoped": "true", "connection": "smartlook2" } } }, "expect": { "uids": { "mode": "edit" } } }, "parameters": [ { "name": "__IMTCONN__", "type": "account:smartlook2", "label": "Connection", "required": true } ], "expect": [ { "name": "uids", "type": "array", "label": "Uids", "required": true, "spec": { "type": "text", "label": "uid", "name": "value" } }, { "name": "uids", "type": "array", "label": "Uids", "required": true, "spec": { "type": "text", "label": "uid", "name": "value" } } ] } } ``` -------------------------------- ### Get Funnel Visitors Drop-off List Source: https://integrations.smartlook.com/docs/searching-funnels-for-drop-off-users Retrieve a list of visitors who either succeeded or dropped off at a specific step in a funnel within a given date range. ```APIDOC ## GET /api/v1/funnels//visitors/drop-off ### Description Searches for users who have dropped off at a specific step in a funnel. ### Method GET ### Endpoint `https://api.eu.smartlook.cloud/api/v1/funnels//visitors/drop-off` ### Query Parameters - **dateFrom** (string) - Required - The date to start the search (YYYY-MM-DD). - **dateTo** (string) - Required - The date to end the search (YYYY-MM-DD). - **step** (integer) - Required - The step of the funnel to search. The first step is 0. - **success** (boolean) - Required - `true` to find users who continued to the specified step, `false` to find users who dropped off before the specified step. ### Request Example ``` GET https://api.eu.smartlook.cloud/api/v1/funnels//visitors/drop-off?dateFrom=2023-06-10&dateTo=2023-06-13&step=1&success=true ``` ### Response #### Success Response (200) - **totalVisitorsCount** (integer) - The total number of visitors found. - **visitors** (array of strings) - A list of visitor IDs. #### Response Example ```json { "totalVisitorsCount": 3, "visitors": ["visitor-id-1", "visitor-id-2", "visitor-id-3"] } ``` ``` -------------------------------- ### Java: Log Smartlook URLs to Amplitude Source: https://integrations.smartlook.com/docs/mobile-integrations-amplitude This Java code demonstrates how to integrate Smartlook with Amplitude by logging user and session URLs. It uses listeners to capture URL changes. ```java // User URL integration Smartlook.getInstance().getUser().getListeners().add(url -> { Identify identify = new Indetify(); identify.set("Smartlook User dahsboard URL", url); Amplitude.getInstance().identify(identify); }); // Session URL integration Smartlook.getInstance().getUser().getSession().getListeners().add(url -> { JSONObject eventProperties = new JSONObject(); try { eventProperties.put("Session url", dashboardSessionUrl); } catch (JSONException exception) { } Amplitude.getInstance().logEvent("Smartlook session URL", eventProperties); }); ``` -------------------------------- ### Java: Track Smartlook URLs with Mixpanel Source: https://integrations.smartlook.com/docs/mobile-integrations-mixpanel Implement Java code to send Smartlook user and session URLs to Mixpanel. Ensure both SDKs are properly initialized. ```java // User URL integration Smartlook.getInstance().getUser().getListeners().add(url -> { mixpanel.getPeople().set("Smartlook User dashboard URL", url); }); // Session URL integration Smartlook.getInstance().getUser().getSession().getListeners().add(url -> { JSONObject eventProperties = new JSONObject(); try { eventProperties.put("URL", url); } catch (JSONException exception) { } mixpanel.track("Smartlook session URL", eventProperties); }); ``` -------------------------------- ### Track Smartlook URLs with Heap in Swift Source: https://integrations.smartlook.com/docs/mobile-integrations-heap Integrate Smartlook with Heap in Swift by observing session and user URL change notifications. Session URLs are tracked as events, and visitor URLs are added as user properties. ```swift 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 { Heap.track("Smartlook session URL", withProperties: [ "session_url": sessionUrl.absoluteString ]) } } NotificationCenter.default.addObserver(forName: User.urlDidChangeNotification, object: nil, queue: nil) { notification in if let smartlook = notification.object as? Smartlook { let visitorUrl = smartlook.user.url Heap.addUserProperties([ "smartlook_visitor_url": visitorUrl.absoluteString ]) } } ``` -------------------------------- ### Smartlook and Heap Integration in TypeScript Source: https://integrations.smartlook.com/docs/mobile-integrations-heap This TypeScript snippet shows how to integrate Smartlook with Heap by registering callbacks for user and session URL changes. It tracks session URLs as events and user URLs as properties. ```typescript function sessionUrlChangedCallback(sessionUrl: string) { heap.track( "Smartlook session URL", {"session_url": sessionUrl}); } function userUrlChangedCallback(userUrl: string) { heap.addUserProperties({'smartlook_user_url': userUrl}); } Smartlook.instance.eventListeners.registerUserChangedListener(userUrlChangedCallback); Smartlook.instance.eventListeners.registerSessionChangedListener(sessionUrlChangedCallback); ``` -------------------------------- ### Kotlin: Track Smartlook URLs with Mixpanel Source: https://integrations.smartlook.com/docs/mobile-integrations-mixpanel Use Kotlin to set user dashboard URLs and track session URLs with Mixpanel. Requires Smartlook SDK and Mixpanel SDK integration. ```kotlin // User URL integration Smartlook.instance.user.listeners += object : User.Listener { override fun onUrlChanged(url: URL) { mixpanel.getPeople().set("Smartlook User dashboard URL", url.toString()) } } // Session URL integration Smartlook.instance.user.session.listeners += object : Session.Listener { override fun onUrlChanged(url: URL) { val eventProperties = JSONObject() .put("URL", url.toString()) mixpanel.track("Smartlook session", eventProperties) } } ``` -------------------------------- ### Swift: Track Smartlook URLs with Mixpanel Source: https://integrations.smartlook.com/docs/mobile-integrations-mixpanel Utilize Swift to capture Smartlook session and user URLs via NotificationCenter and send them to Mixpanel. Requires Mixpanel's Swift SDK. ```swift 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 { mixpanel?.track(event: "Smartlook session URL", properties: [ "session_url": sessionUrl]) } } NotificationCenter.default.addObserver(forName: User.urlDidChangeNotification, object: nil, queue: nil) { notification in if let smartlook = notification.object as? Smartlook { let visitorUrl = smartlook.user.url mixpanel?.people.set(property: "smartlook_visitor_url", to: visitorUrl) } } ``` -------------------------------- ### Setting up Notes Webhook Source: https://integrations.smartlook.com/docs/notes-webhook Use this endpoint to register a webhook URL that will receive notifications when notes are added or updated in Smartlook sessions. You can optionally provide a secret for signature verification. ```APIDOC ## POST /api/v1/webhooks ### Description Registers a webhook to receive notifications for note events. ### Method POST ### Endpoint /api/v1/webhooks ### Request Body - **url** (string) - Required - The URL where the webhook events will be sent. - **type** (string) - Required - Must be set to "notes" to receive note-related events. - **secret** (string) - Optional - A secret key used for signing webhook events for verification. ``` -------------------------------- ### Searching for Users Source: https://integrations.smartlook.com/docs/searching-users Use this endpoint to search for visitors in your project. You can specify filters to narrow down the search results. ```APIDOC ## POST /api/v2/visitors/search ### Description Searches for visitors in your project based on specified filters. ### Method POST ### Endpoint https://api.eu.smartlook.cloud/api/v2/visitors/search ### Parameters #### Request Body - **filters** (array) - Required - An array of filter objects to apply to the search. - Each filter object must contain: - **name** (string) - Required - The name of the filter field (e.g., `uid`, `visitor_id`, `recording_date`, `user_first_seen`). - **operator** (string) - Required - The operator to use for the filter (e.g., `is`, `is_not`, `contains`, `not_contains`, `before`, `after`, `in_range`). - **value** (string | array) - Required - The value(s) to filter by. Can be a single value, an array of values for OR conditions, or a date range for `in_range`. ### Request Example ```json { "filters": [ { "name": "recording_date", "operator": "is", "value": "2023-05-18" } ] } ``` ### Response #### Success Response (200) - **visitors** (array) - A list of visitor objects matching the search criteria. #### Response Example ```json { "visitors": [ { "visitorId": "visitor_abc123", "uid": "user_xyz789", "firstSeen": "2023-05-18T10:00:00Z", "lastSeen": "2023-05-18T11:00:00Z", "tags": ["tag1", "tag2"] } ] } ``` ``` -------------------------------- ### Register Smartlook Integration Listener in Java Source: https://integrations.smartlook.com/docs/mobile-integrations-heap This Java code registers a listener to capture Smartlook session and visitor URLs, sending them to Heap. Session URLs are tracked as events, and visitor URLs are added as user properties. ```java Smartlook.registerIntegrationListener(new IntegrationListener() { @Override public void onSessionReady(@NotNull String dashboardSessionUrl) { Map props = new HashMap<>(); props.put("Session url", dashboardSessionUrl); Heap.track("Smartlook session URL", props); } @Override public void onVisitorReady(@NotNull String dashboardVisitorUrl) { Map props = new HashMap<>(); props.put("Smartlook visitor URL", dashboardVisitorUrl); Heap.addUserProperties(props); } }); ``` -------------------------------- ### Create Smartlook Session Link in Salesforce Source: https://integrations.smartlook.com/docs/salesforce Use this formula in a Salesforce custom formula field to create a clickable link to Smartlook recordings, filtered by the lead or contact's email. Replace ORGANZATION_ID and PROJECT_ID with your Smartlook account details. ```salesforce HYPERLINK("https://app.smartlook.com/org/ORGANIZATION_ID/project/PROJECT_ID/recordings?filterEmail=" & Email, "Smartlook sessions", "https://app.smartlook.com/org/ORGANIZATION_ID/project/PROJECT_ID/recordings?filterEmail=" & Email) ``` -------------------------------- ### Setting Query Limit for Session Search Source: https://integrations.smartlook.com/docs/search-user-sessions Demonstrates how to set a custom limit for the number of search results returned. The default is 10, and the maximum is 100. ```http POST https://api.eu.smartlook.cloud/api/v1/sessions/search?limit=10 ``` -------------------------------- ### Import Blueprint for Google Sheets Integration Source: https://integrations.smartlook.com/docs/deleting-users This JSON defines a make.com Blueprint for integrating with Google Sheets to filter rows. It includes parameters for connection, spreadsheet ID, sheet name, and filtering conditions. ```json { "name": "Integration Google Sheets", "flow": [ { "id": 1, "module": "google-sheets:filterRows", "version": 2, "parameters": { "__IMTCONN__": 505432 }, "mapper": { "from": "drive", "valueRenderOption": "FORMATTED_VALUE", "dateTimeRenderOption": "FORMATTED_STRING", "limit": "300", "spreadsheetId": "", "sheetId": "Sheet1", "includesHeaders": false, "tableFirstRow": "A1:Z1", "filter": [ [ { "a": "A", "o": "exist" } ] ], "sortOrder": "asc" }, "metadata": { "designer": { "x": 0, "y": 0 }, "restore": { "parameters": { "__IMTCONN__": { "label": "My Google connection", "data": { "scoped": "true", "connection": "google" } } }, "expect": { "from": { "label": "Select from My Drive" }, "valueRenderOption": { "mode": "chose", "label": "Formatted value" }, "dateTimeRenderOption": { "mode": "chose", "label": "Formatted string" }, "spreadsheetId": { "mode": "chose", "label": "Delete Visitors" }, "sheetId": { "mode": "chose", "label": "Sheet1" }, "includesHeaders": { "mode": "chose", "label": "No" }, "tableFirstRow": { "label": "A-Z" }, "sortOrder": { "mode": "chose", "label": "Ascending" }, "orderBy": { "mode": "chose" } } }, "parameters": [ { "name": "__IMTCONN__", "type": "account:google", "label": "Connection", "required": true } ], "expect": [ { "name": "from", "type": "select", "label": "Enter a Spreadsheet ID and Sheet Name", "required": true, "validate": { "enum": [ "drive", "share" ] } }, { "name": "valueRenderOption", "type": "select", "label": "Value render option", "validate": { "enum": [ "FORMATTED_VALUE", "UNFORMATTED_VALUE", "FORMULA" ] } }, { ``` -------------------------------- ### Kotlin: Log Smartlook URLs to Amplitude Source: https://integrations.smartlook.com/docs/mobile-integrations-amplitude Use this Kotlin code to log Smartlook user and session dashboard URLs to Amplitude. It requires setting up listeners for URL changes. ```kotlin // User URL integration Smartlook.instance.user.listeners += object : User.Listener { override fun onUrlChanged(url: URL) { Identify identify = Indetify() identify.set("Smartlook User dashboard URL", url.toString()) Amplitude.getInstance().identify(identify) } } // Session URL integration Smartlook.instance.user.session.listeners += object : Session.Listener { override fun onUrlChanged(url: URL) { val eventProperties = JSONObject().put("URL", url.toString()) Amplitude.getInstance().logEvent("Smartlook session", eventProperties) } } ``` -------------------------------- ### Dart: Log Smartlook URLs to Amplitude Source: https://integrations.smartlook.com/docs/mobile-integrations-amplitude Implement a custom listener in Dart to capture Smartlook session and visitor URLs and send them to Amplitude. This requires registering the listener during initialization. ```dart class CustomIntegrationListener implements IntegrationListener { @override void onSessionReady(String? dashboardSessionUrl) { analytics.logEvent('Smartlook session URL', eventProperties: { 'session_url': dashboardSessionUrl }); } @override void onVisitorReady(String? dashboardVisitorUrl) { final Identify identify = Identify() ..set('smartlook_visitor_url', dashboardVisitorUrl) analytics.identify(identify); } } //Put to your init state or some place you want to register this Smartlook.instance.registerIntegrationListener(CustomIntegrationListener()); ``` -------------------------------- ### Create Heatmaps Webhook Source: https://integrations.smartlook.com/docs/heatmaps-webhook Use this endpoint to register a webhook URL that will receive notifications when a heatmap is finished. ```APIDOC ## POST /api/v1/webhooks ### Description Registers a webhook to receive notifications for heatmap completion. ### Method POST ### Endpoint /api/v1/webhooks ### Request Body - **url** (string) - Required - The URL where the webhook payload will be sent. - **type** (string) - Required - Must be set to "heatmaps" to receive heatmap-related events. - **secret** (string) - Optional - A secret key used for verifying the webhook's authenticity. ``` -------------------------------- ### Create Issues Webhook Source: https://integrations.smartlook.com/docs/issues-webhook This endpoint allows you to set up a webhook to receive 'issues' events. You need to provide a URL where the webhook events will be sent and an optional secret for signature verification. ```APIDOC ## POST /api/v1/webhooks ### Description Creates a new webhook subscription for 'issues' events. ### Method POST ### Endpoint /api/v1/webhooks ### Parameters #### Request Body - **url** (string) - Required - The URL to send webhook events to. - **type** (string) - Required - Must be set to "issues". - **secret** (string) - Optional - A secret string used for signing webhook events. ### Request Example ```json { "url": "https://some-url.com", "type": "issues", "secret": "some-secret" } ``` ### Response #### Success Response (200) This endpoint does not explicitly define a success response body in the documentation. However, a typical response would confirm the creation of the webhook. #### Response Example ```json { "type": "issues.created", "timestamp": "Date", "project": { "id": "String", "name": "String" }, "organization": { "id": "String", "name": "String" }, "data": { "author": { "name": "String", "email": "String" }, "visitor": { "id": "String" }, "session": { "id": "String", "url": "String" }, "summary": "String", "text": "String", "time": "Number", "createdAt": "Date" } } ``` ``` -------------------------------- ### TypeScript: Log Smartlook URLs to Amplitude Source: https://integrations.smartlook.com/docs/mobile-integrations-amplitude This TypeScript code snippet shows how to register listeners for Smartlook URL changes and log them to Amplitude. It handles both user and session URLs. ```typescript function sessionUrlChangedCallback(sessionUrl: string) { amplitude.logEvent( "Smartlook session URL", {"session_url": sessionUrl}); ); } function userUrlChangedCallback(userUrl: string) { var identify = new amplitude.Identify().set("smartlook_visitor_url", userUrl); amplitude.identify(identify); } Smartlook.instance.eventListeners.registerUserChangedListener(userUrlChangedCallback); Smartlook.instance.eventListeners.registerSessionChangedListener(sessionUrlChangedCallback); ``` -------------------------------- ### Response Sorting Object Source: https://integrations.smartlook.com/docs/search-user-sessions Specifies the format for the optional `sort` object to control the order of search results. Defaults to 'asc' if not provided. ```text {timeStart: 'asc'|'desc'} ``` -------------------------------- ### Search Users with Multiple UID Filters (OR Condition) Source: https://integrations.smartlook.com/docs/searching-users Demonstrates how to use an array for the 'value' field to perform an OR search for multiple user IDs. This is applicable for filters like 'uid' and 'visitor_id'. ```json { "name": "uid", "operator": "is", "value": ["user123", "user456"] } ``` -------------------------------- ### Setting up Dashboards Webhooks Source: https://integrations.smartlook.com/docs/dashboards-webhook Use this endpoint to register a new webhook for dashboard reports. You can specify the URL to receive notifications, the type of webhook, and an optional secret for signature verification. ```APIDOC ## POST /api/v1/webhooks ### Description Registers a new webhook for dashboard reports. ### Method POST ### Endpoint /api/v1/webhooks ### Request Body - **url** (string) - Required - The URL where the webhook notifications will be sent. - **type** (string) - Required - Must be set to "dashboards" for dashboard reports. - **secret** (string) - Optional - A secret key used for verifying webhook signatures. ``` -------------------------------- ### Create Heatmaps Webhook Source: https://integrations.smartlook.com/docs/heatmaps-webhook Use this endpoint to register a webhook for heatmap completion events. The secret is optional but recommended for verifying webhook authenticity. ```http POST /api/v1/webhooks "url": "https://some-url.com", "type": "heatmaps", "secret": "some-secret" //optional } ``` -------------------------------- ### Swift: Log Smartlook URLs to Amplitude Source: https://integrations.smartlook.com/docs/mobile-integrations-amplitude Integrate Smartlook with Amplitude using Swift by observing notifications for URL changes. This code logs both user and session URLs. ```swift 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 { Amplitude.instance()?.logEvent("Smartlook session URL", withEventProperties: [ "session_url": sessionUrl]) } } NotificationCenter.default.addObserver(forName: User.urlDidChangeNotification, object: nil, queue: nil) { notification in if let smartlook = notification.object as? Smartlook { let visitorUrl = smartlook.user.url let identify = AMPIdentify().add("smartlook_visitor_url", value: visitorUrl.absoluteString as NSString) Amplitude.instance()?.identify(identify) } } ``` -------------------------------- ### Create Webhook API Request Source: https://integrations.smartlook.com/docs/webhooks Use this POST request to create a new webhook. Specify the client URL, webhook type, and an optional secret for security. ```text POST /api/v1/webhoooks BODY: { "url": "https://yourUrl.com", "type": "", "secret": "your-secret" } ``` -------------------------------- ### Search Visitors by ID Source: https://integrations.smartlook.com/docs/searching-funnels-for-drop-off-users Use a POST request to the `/visitors/search` endpoint with a list of visitor IDs to retrieve detailed visitor information. This is useful after obtaining a list of drop-off visitors. ```http POST https://api.eu.smartlook.cloud/api/v2/visitors/search { "filters": [ { "name": "visitor_id", "operator": "is", "value": ["visitor-id-1", "visitor-id-2", "visitor-id-3"] } ] } ``` -------------------------------- ### Dart: Track Smartlook URLs with Mixpanel Source: https://integrations.smartlook.com/docs/mobile-integrations-mixpanel Implement a custom listener in Dart to capture Smartlook session and visitor URLs and send them to Mixpanel. Remember to call `identify` when using `people.set`. ```dart class CustomIntegrationListener implements IntegrationListener { @override void onSessionReady(String? dashboardSessionUrl) { mixpanel.track( "Smartlook session URL", {"session_url": dashboardSessionUrl}); } @override void onVisitorReady(String? dashboardVisitorUrl) { mixpanel.getPeople().set("smartlook_user_url", dashboardVisitorUrl); // identify must be called along with every instance of people.set mixpanel.identify("sample_identifier"); } } //Put to your init state or some place you want to register this Smartlook.registerIntegrationListener(CustomIntegrationListener()); ``` -------------------------------- ### Track Event with Mixpanel Source: https://integrations.smartlook.com/docs/mixpanel Use this to send custom events to Mixpanel. Ensure Mixpanel is integrated into your project. ```javascript mixpanel.track(NAME OF YOUR EVENT) ``` -------------------------------- ### Search Users with Recording Date Filter Source: https://integrations.smartlook.com/docs/searching-users Use this POST call to search for visitors based on their recording date. Ensure the date is in 'YYYY-MM-DD' format. ```json POST https://api.eu.smartlook.cloud/api/v2/visitors/search { "filters": [ { "name": "recording_date", "operator": "is", "value": "2023-05-18" } ] } ``` -------------------------------- ### Search Sessions by User ID Source: https://integrations.smartlook.com/docs/search-user-sessions Filter sessions for specific users by providing an array of user IDs to the `uid` filter with the `is` operator. Sessions can be sorted by `timeStart`. ```text POST https://api.eu.smartlook.cloud/api/v1/sessions/search { "filters": [ { "name": "uid", "operator": "is", "value": ["some-user-id-1", "some-user-id-2"] } ], "sort": { "timeStart": "asc" } } ``` -------------------------------- ### Search Users with Custom Query Limit Source: https://integrations.smartlook.com/docs/searching-users Append the `?limit=` query parameter to your POST request to control the number of results returned. The default is 100, and the maximum is also 100. ```http POST https://api.eu.smartlook.cloud/api/v2/visitors/search?limit=10 ``` -------------------------------- ### Webhook Creation Response Source: https://integrations.smartlook.com/docs/webhooks The API responds with a unique ID upon successful webhook creation. ```json { "id": "webhook_id" } ``` -------------------------------- ### Register Smartlook Integration Listener in Kotlin Source: https://integrations.smartlook.com/docs/mobile-integrations-heap Use this snippet to register a listener that tracks Smartlook session and visitor URLs within your Kotlin application. It sends session URLs as events and visitor URLs as user properties to Heap. ```kotlin Smartlook.registerIntegrationListener(object : IntegrationListener { override fun onSessionReady(dashboardSessionUrl: String) { val props = mapOf("Session url" to dashboardSessionUrl) Heap.track("Smartlook session URL", props) } override fun onVisitorReady(dashboardVisitorUrl: String) { val props = mapOf("Smartlook visitor URL" to dashboardVisitorUrl) Heap.addUserProperties(props) } }) ``` -------------------------------- ### Add Smartlook Session URL to Bugsnag Errors (Java) Source: https://integrations.smartlook.com/docs/mobile-integrations-bugsnag This Java code snippet demonstrates how to attach the Smartlook session dashboard URL to Bugsnag error reports. It requires Smartlook to be initialized. ```java OnErrorCallback errorCallback = event -> { event.addMetadata("Smartlook", "Smartlook session dashboard URL", Smartlook.getInstance().getUser().getSession().getUrlWithTimestamp()); return true; }; Bugsnag.addOnError(errorCallback); ``` -------------------------------- ### Authenticate API Request Source: https://integrations.smartlook.com/docs/api-overview Include this header in your requests to authenticate with the Smartlook API using your Bearer token. ```bash Authorization: Bearer ``` -------------------------------- ### Add Smartlook Session URL to Bugsnag Errors (Kotlin) Source: https://integrations.smartlook.com/docs/mobile-integrations-bugsnag Use this Kotlin code to add the Smartlook session dashboard URL as metadata to Bugsnag error events. Ensure Smartlook is initialized before this. ```kotlin val errorCallback = OnErrorCallback { event.addMetadata("Smartlook", "Smartlook session dashboard URL", Smartlook.instance.user.session.urlWithTimestamp) true //report this error } Bugsnag.addOnError(errorCallback) ``` -------------------------------- ### Set Smartlook URLs as Crashlytics Custom Keys (Swift) Source: https://integrations.smartlook.com/docs/mobile-integrations-firebase-crashlytics Use Swift to observe notifications for user and session URL changes from Smartlook and set them as custom values in Crashlytics. ```swift 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 { Crashlytics.crashlytics().setCustomValue(sessionUrl, forKey: "Smartlook session URL") } } } NotificationCenter.default.addObserver(forName: User.urlDidChangeNotification, object: nil, queue: nil) { notification in if let smartlook = notification.object as? Smartlook { let visitorUrl = smartlook.user.url Crashlytics.crashlytics().setCustomValue(visitorUrl, forKey: "Smartlook visitor URL") } } ``` -------------------------------- ### Search Sessions by Duration Source: https://integrations.smartlook.com/docs/search-user-sessions Use the `session_duration` filter with `lte` and `gte` operators to find sessions within a specific time range. Results can be sorted using the `sort` parameter. ```text POST https://api.eu.smartlook.cloud/api/v1/sessions/search { "filters": [ { "name": "session_duration", "operator": "lte", "value": 40 }, { "name": "session_duration", "operator": "gte", "value": 30 } ], "sort": { "timeStart": "asc" } } ```