### Developer Integration Options Source: https://documentation.blitzllama.com/sdk/web Guidance for developers on advanced Blitzllama integration methods. This includes installing via NPM, managing user attributes, setting code triggers, and utilizing completion callbacks for custom behaviors. ```APIDOC Developer Integration: 1. Installation: - Install via NPM. 2. User Management: - Manage user attributes. 3. Triggering Events: - Set code triggers for precise control. 4. Callbacks: - Leverage completion callbacks for advanced behaviors. ``` -------------------------------- ### Install Blitzllama via NPM Source: https://documentation.blitzllama.com/sdk/web Instructions for installing the Blitzllama JavaScript SDK using package managers like NPM or Yarn. This is recommended for modern frontend frameworks and TypeScript projects. ```bash npm i blitzllama-js ``` ```bash yarn add blitzllama-js ``` -------------------------------- ### Install Blitzllama iOS SDK via Cocoapods Source: https://documentation.blitzllama.com/sdk/ios Instructions for adding the Blitzllama iOS SDK to your project using Cocoapods. This is the recommended installation method for iOS development. ```bash pod 'Blitzllama-ios', '1.6.29' ``` -------------------------------- ### Initialize Blitzllama SDK (NPM) Source: https://documentation.blitzllama.com/sdk/web This code demonstrates how to import and initialize the Blitzllama SDK within your application after installing it via NPM. Place the initialization as high as possible in your application's component tree. ```javascript import blitz from 'blitzllama-js'; //initialize blitzllama SDK. Place this as higher in your app as possible blitz.init("api_key"); //You can find your API_KEY by navigating to Connections tab > Web //on Blitzllama's dashboard. ``` -------------------------------- ### Flutter SDK Setup and Initialization Source: https://documentation.blitzllama.com/sdk/flutter Instructions for adding the Blitzllama Flutter SDK dependency to your project and initializing it with your API key. This is the first step to enable survey functionality. ```yaml dependencies: blitzllama_flutter: ^0.6.3 ``` ```bash flutter pub get ``` ```dart import 'package:blitzllama_flutter/blitzllama_flutter.dart'; // ... BlitzllamaFlutter.init(""); ``` ```ruby target 'Runner' do use_frameworks! pod 'SwiftyJSON' flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end ``` -------------------------------- ### Amplitude Cohort Sync Setup Source: https://documentation.blitzllama.com/connections-sources/amplitude Guides users through setting up the Cohort Sync integration between Blitzllama and Amplitude. This allows launching in-product surveys to specific user cohorts defined in Amplitude. ```APIDOC Blitzllama Setup: 1. Navigate to Connections tab on Blitzllama's dashboard. 2. Click Amplitude under Sources. 3. Click Connect and copy the API key. Amplitude Setup: 1. In Amplitude Data, navigate to Catalog > Destinations tab. 2. In the Cohort section, click Blitzllama. 3. Click Add another destination. 4. Enter Name and Blitzllama's API Key. 5. Save the destination. Send a Cohort: 1. In Amplitude, open the desired cohort. 2. Click Sync, and choose Blitzllama. 3. Select the destination. 4. Select the sync cadence. 5. Save. Notes: - Cohort updates reflect within 15 minutes. - Available on all Blitzllama plans. ``` -------------------------------- ### Initialize Blitzllama SDK Source: https://documentation.blitzllama.com/sdk/android This section provides code examples for initializing the Blitzllama SDK. You should extend your `Application` class with `BlitzLlamaSDK` and call the `init` method within `onCreate`. ```Java public class MyApplication extends BlitzLlamaSDK { @Override public void onCreate() { super.onCreate(); BlitzLlamaSDK.init(this); } } ``` ```Kotlin override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) BlitzLlamaSDK.init(this); } ``` -------------------------------- ### Initialize Blitzllama via Script Injection (No-Code) Source: https://documentation.blitzllama.com/sdk/web This snippet demonstrates how to add the Blitzllama client-side script to your website's HTML. It initializes the SDK by pushing commands to a queue, allowing for immediate feedback collection without complex setup. ```html ``` -------------------------------- ### Install Blitzllama React Native SDK Source: https://documentation.blitzllama.com/sdk/react-native Installs the Blitzllama React Native SDK and its required dependencies using either NPM or Yarn. Ensure you have the necessary packages like async-storage, checkbox, and webview installed. ```javascript npm install @react-native-async-storage/async-storage @react-native-community/checkbox react-native-webview npm install react-native-blitzllama@1.5.0 ``` ```javascript yarn add @react-native-async-storage/async-storage @react-native-community/checkbox react-native-webview yarn add react-native-blitzllama@1.5.0 ``` -------------------------------- ### Blitzllama Tag Configuration in GTM Source: https://documentation.blitzllama.com/sdk/google-tag-manager Guides the setup of the Blitzllama Tag within Google Tag Manager, including API key integration and user management strategies. ```APIDOC Blitzllama GTM Tag Setup: Install Blitzllama Tag from GTM Community Template Gallery. Configuration: API Key: - Obtain from Blitzllama dashboard (Connections > Web). - Paste into the API key section of the Blitzllama GTM template. User Management Options: 1. Identify users with user_ids (Recommended): - Set Action Type to 'User Id'. - Select a variable for UserId. - Configure Triggering (e.g., 'All Pages' or 'Some Pages'). 2. Anonymous User Tracking: - Set Action Type to 'Install'. - Configure Triggering (e.g., 'All Pages'). Send User Attribute (Optional): - Set Action Type to 'User Attribute'. - Attribute Key: Enter the field name for the attribute. - Attribute Value: Select the variable for the attribute's value. - Data Type: Select the appropriate data type (string, number, boolean, date). - Configure Triggering based on attribute availability. Important Notes: - Ensure user creation Blitzllama Tag is called before User Attribute Tag (Trigger Sequencing). - Refer to GTM documentation for variables and triggers. ``` -------------------------------- ### Amplitude Events Streaming Setup Source: https://documentation.blitzllama.com/connections-sources/amplitude Details the setup for Amplitude's Events Streaming via Webhook to Blitzllama. This enables real-time survey launches based on user actions captured by Amplitude. ```APIDOC Amplitude Setup (Destinations): 1. In Amplitude Data, navigate to Catalog > Destinations tab. 2. In the Event Streaming section, click Webhook. 3. Enter a sync name (e.g., "Blitzllama Events Stream") and click Create Sync. 4. Toggle Status to Enabled. Blitzllama Setup (Data Import): 1. In Blitzllama, navigate to Connections > Data Import > Amplitude. 2. Copy the Stream URL and API Key from the Events Streaming section. Amplitude Setup (Webhook Configuration): 1. Return to Amplitude's Webhook settings. 2. Paste the copied Stream URL into the Webhook URL field. 3. Add a new header: - Key: authorization - Value: [Copied Blitzllama API Key] 4. Toggle on Send Events. 5. Keep default Event Payload. 6. Choose events to trigger surveys. Launching Surveys with Events: 1. In Blitzllama, open Survey Editor > Configuration tab. 2. Under Select Survey Trigger, choose the Amplitude event. 3. Configure view triggers (e.g., MainActivity). Notes: - This integration is available on Blitzllama's Scale plan. - Refer to Amplitude's Webhook documentation for more details. ``` -------------------------------- ### Blitzllama User and Survey Management Source: https://documentation.blitzllama.com/sdk/ios Documentation for core Blitzllama functions related to user sessions and survey fetching. Ensure proper sequencing for correct behavior. ```APIDOC createUser() - Description: Initializes or manages a user session. Must be called before triggering events that depend on user context. - Usage: Call `createUser()` to ensure the user session is active. - Troubleshooting: If surveys are not showing, verify that `createUser` has been called prior to the relevant event trigger. logout() - Description: Ends the current user session. Essential when switching between different user contexts. - Usage: Call `logout()` before calling `createUser()` again for a new user to prevent session conflicts. fetchSurvey(trigger_name) - Description: Fetches a survey associated with a specific trigger. - Parameters: - trigger_name: string - The name of the trigger configured in Blitzllama or your application. - Usage: Use `fetchSurvey` with the correct `trigger_name` to display relevant surveys. - Related: `trigger_name` configuration. trigger_name Configuration - Description: A unique identifier for user actions that should trigger surveys. Triggers can be created within your application or on the Blitzllama dashboard. - Creation: - Add a new `trigger_name` in your app's code. If it doesn't exist, it will be automatically created and appear on the dashboard. - Alternatively, create the trigger on the Blitzllama dashboard first, then use the same `trigger_name` in your `fetchSurvey` calls. - Troubleshooting: Ensure the `trigger_name` in your code exactly matches the one configured in the Blitzllama dashboard to avoid issues with surveys not appearing. ``` -------------------------------- ### Create Blitzllama User Source: https://documentation.blitzllama.com/sdk/android Code examples for creating a user within the Blitzllama SDK. A unique user ID must be provided before triggering surveys to ensure proper tracking and personalization. ```Java BlitzLlamaSDK.getSdkManager(this).createUser("user_id"); ``` ```Kotlin BlitzLlamaSDK.getSdkManager(this).createUser("user_id") ``` -------------------------------- ### Initialize Blitzllama SDK in AppDelegate Source: https://documentation.blitzllama.com/sdk/ios Code snippet to initialize the Blitzllama SDK by setting your API key in the application's AppDelegate or SceneDelegate. This is a crucial step before using other SDK functionalities. ```swift import BlitzLlamaSDK import UIKit @main class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { //initialisation Blitzllama BlitzLlamaSDKController.getSDKManager.setBlitzLlamaAPIKey("API_KEY") return true } } ``` -------------------------------- ### DataLayer Implementation Example Source: https://documentation.blitzllama.com/sdk/google-tag-manager Demonstrates how to initialize and push data to the DataLayer object in JavaScript. This is essential for passing user information and event data from a website to Google Tag Manager for trigger activation. ```javascript ``` -------------------------------- ### Create a User with Unique ID Source: https://documentation.blitzllama.com/sdk/ios Method to create a user within the Blitzllama SDK using a unique identifier. This helps in tracking users and preventing duplicate survey prompts. ```swift BlitzLlamaSDKController.getSDKManager.createUser("user_id") ``` -------------------------------- ### Blitzllama SDK Custom CSS Configurations Source: https://documentation.blitzllama.com/sdk/web Configure custom CSS for survey elements to match your application's branding. Supports alignment for feedback types and custom close icon URLs. ```javascript //we support the following four configurations. { star_feedback: { textalign: 'center' }, nps_feedback: { textalign: 'center' }, scale_feedback: { textalign: 'center' }, close_icon_url: '', font_scale: 1 } ``` -------------------------------- ### Set User Email and Name with Blitzllama SDK Source: https://documentation.blitzllama.com/sdk/web Set the user's email and name to personalize survey experiences. This helps in identifying and segmenting users for targeted feedback collection. ```javascript blitz('setUserEmail', 'user_email'); blitz('setUserName', 'user_name'); ``` ```javascript blitz.setUserEmail('user_email'); blitz.setUserName('user_name'); ``` -------------------------------- ### Initialize Blitzllama SDK and Create User Source: https://documentation.blitzllama.com/sdk/react-native Demonstrates the early initialization of the Blitzllama SDK with an API key and the creation of a user profile. These steps should be performed at the application's entry point before components that might trigger surveys are mounted. ```javascript import { blitz } from 'react-native-blitzllama'; const blitzSetup = async() => { await blitz.init('api_key'); // call createUser once in the app’s lifetime for each unique user await blitz.createUser('user_id'); // optionally set user attribute or set survey language here }; // Call blitzSetup() at a high point in the app lifecycle. // Ensure blitzSetup() loads before a component is mounted. ``` -------------------------------- ### Trigger a Survey by Trigger Name Source: https://documentation.blitzllama.com/sdk/ios Initiates fetching and displaying a survey based on a predefined trigger name configured in the Blitzllama dashboard. Ensure the trigger name matches your dashboard setup. ```swift BlitzLlamaSDKController.getSDKManager.fetchSurvey(triggerName: "triggerName") ``` -------------------------------- ### Initialize User with Callback Source: https://documentation.blitzllama.com/sdk/android Demonstrates how to initialize a user with the BlitzLlama SDK, passing a callback function to handle success or failure. This is crucial for managing race conditions and ensuring proper SDK operation. ```kotlin import com.blitzllama.androidSDK.SdkInitialisationSuccessCallback .. .. val clbk = object : SdkInitialisationSuccessCallback{ override fun onSuccess() { BlitzLlamaSDK.getSdkManager(this@HomeActivity).triggerEvent("MainActivity") } override fun onFailure() { BlitzLlamaSDK.getSdkManager(this@HomeActivity).triggerEvent("MainActivity") } } BlitzLlamaSDK.getSdkManager(this).createUser("user_id", clbk); ``` -------------------------------- ### Set blitzllama_user_id in Mixpanel (Kotlin, Swift, JavaScript) Source: https://documentation.blitzllama.com/connections-sources/mixpanel Demonstrates how to set the `blitzllama_user_id` user property in Mixpanel for user matching between platforms. This property is crucial for linking user profiles between Mixpanel and Blitzllama. The examples cover Android (Kotlin), iOS (Swift), and JavaScript implementations. ```kotlin //Sets user attribute "blitzllama_user_id" to "123" mixpanel.people.set("blitzllama_user_id", "123" ); ``` ```swift Mixpanel.mainInstance().people.set(properties: [ "blitzllama_user_id":"Premium"]) ``` ```javascript //Sets user attribute "blitzllama_user_id" to "123" mixpanel.people.set("blitzllama_user_id", "123" ); ``` -------------------------------- ### Initialize Blitzllama SDK Source: https://documentation.blitzllama.com/sdk/react-native Initializes the Blitzllama SDK with your unique API key. This should be called as early as possible in your application's lifecycle, typically in the main application file. ```javascript import { blitz } from 'react-native-blitzllama'; //initialize blitzllama SDK. Place this as higher in your app as possible blitz.init(api_key); ``` -------------------------------- ### Update User Name Source: https://documentation.blitzllama.com/sdk/ios Optionally sets the user's name. Similar to email, this can aid in personalizing the survey experience for the user. ```swift BlitzLlamaSDKController.getSDKManager.updateUserName("user_name") ``` -------------------------------- ### CleverTap Webhook Campaign Setup Source: https://documentation.blitzllama.com/connections-sources/clevertap Instructions for configuring a CleverTap Webhook campaign to sync user segments with Blitzllama. This includes specifying the HTTP method, destination URL, and necessary header parameters for authentication and data transfer. ```APIDOC CleverTap Webhook Campaign Configuration: HTTP Method: - POST - Specifies the HTTP method for the webhook request. Destination URL: - - The endpoint provided by Blitzllama to receive webhook data. - Obtain this URL from Blitzllama's dashboard by navigating to the Connections tab and selecting CleverTap. Header Parameters: - Key: "x-api-key" - The API key header required for authentication. - Value: Obtain the specific API key from Blitzllama's dashboard (Connections tab, CleverTap section). Webhook Content Configuration: - Ensure the "Email, Identity and CleverTap ID" option is selected within the webhook content settings. - This selection is critical for Blitzllama to correctly identify and process user data upon syncing. ``` -------------------------------- ### Update User Email Source: https://documentation.blitzllama.com/sdk/ios Optionally sets the user's email address. Providing this information can help personalize surveys and improve user segmentation. ```swift BlitzLlamaSDKController.getSDKManager.updateUserEmail("user_email") ``` -------------------------------- ### Zendesk API Token Generation Source: https://documentation.blitzllama.com/eureka-connections/zendesk Steps to generate a new API token within your Zendesk Admin Center. This token is required to authenticate Blitzllama with your Zendesk account. ```APIDOC Zendesk API Token Generation: 1. Navigate to Zendesk Admin Center. 2. Go to Apps and integrations > APIs > Zendesk API. 3. Select the Settings tab. 4. Enable Token Access. 5. Under Active API Tokens, click 'Add API Token' to generate a new token. 6. Copy and securely store the generated token. It will not be visible again after saving. Related Information: - Retrieve your Zendesk Subdomain (required for connection). - Connect Zendesk to Blitzllama via the Blitzllama Dashboard. ``` -------------------------------- ### Logout User Session Source: https://documentation.blitzllama.com/sdk/ios Logs out the current user, clearing their session data. This is important for maintaining data integrity when users switch accounts or log out of the application. ```swift BlitzLlamaSDKController.getSDKManager.logout() ``` -------------------------------- ### Set Survey Language Source: https://documentation.blitzllama.com/sdk/ios Configures the language for displaying surveys using ISO 639-1 codes. This enhances user experience by presenting surveys in their native language. ```swift BlitzLlamaSDKController.getSDKManager.setLanguageCode("en") ``` -------------------------------- ### Troubleshooting Survey Display Issues Source: https://documentation.blitzllama.com/sdk/web Common troubleshooting steps for ensuring surveys appear correctly. This includes checking API key initialization, no-code trigger conditions, and the order of code execution for code triggers. ```APIDOC Survey Not Appearing Troubleshooting: 1. API Key Initialization: - Ensure the SDK is initialized with the correct `API_KEY`. 2. No-Code Trigger Conditions: - Verify that your no-code trigger conditions accurately match the page URL or the correct CSS selector. 3. Code Trigger Execution Order: - If using code triggers, confirm that `createUser` is called before `triggerEvent` when leveraging user states. ``` -------------------------------- ### BlitzLlama SDK API Reference Source: https://documentation.blitzllama.com/sdk/android Reference for core BlitzLlama SDK methods for Android development. This includes user management, event triggering, and session handling, essential for integrating surveys and user feedback mechanisms. ```APIDOC BlitzLlamaSDK: getSdkManager(context: Context): SdkManager - Retrieves the singleton instance of the SdkManager. - Parameters: - context: The Android Context. - Returns: An instance of SdkManager. SdkManager: createUser(userId: String, callback: SdkInitialisationSuccessCallback? = null) - Initializes or creates a user session within the BlitzLlama SDK. - It's recommended to call this before triggering events or surveys. - Parameters: - userId: A unique identifier for the user. - callback: An optional callback to handle initialization success or failure. - Example: BlitzLlamaSDK.getSdkManager(this).createUser("user_id", callback) triggerEvent(eventName: String) - Triggers a specific event within the SDK, which can be used to initiate surveys or track user actions. - Ensure a user is created before calling this method. - Parameters: - eventName: The name of the event to trigger. - Example: BlitzLlamaSDK.getSdkManager(this).triggerEvent("MainActivity") logout() - Logs out the current user and clears the session. - Should be called before creating a new user to prevent session mixing. - Example: BlitzLlamaSDK.logout() ``` -------------------------------- ### Update User Attributes Source: https://documentation.blitzllama.com/sdk/ios Sets or updates user attributes, which can be strings, numbers, dates, or booleans. These attributes are used for segmenting and targeting specific user groups with surveys. ```swift BlitzLlamaSDKController.getSDKManager.updateUserAttributes("attribute_name", attributeValue: "attribute_value", dataType: "string") ``` -------------------------------- ### Add Blitzllama SDK Dependency and Enable Java 8 Source: https://documentation.blitzllama.com/sdk/android Instructions to add the Blitzllama SDK dependency to your `app/build.gradle` file and configure Java 8 compatibility. This ensures the SDK functions correctly by setting source and target compatibility to Java 8. ```Groovy // app/build.gradle dependencies { implementation 'com.blitzllama:Blitzllama:1.9.1' } android { ... compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } // For Kotlin projects kotlinOptions { jvmTarget = "1.8" } } ``` -------------------------------- ### Logout User Source: https://documentation.blitzllama.com/sdk/web This function is used to stop tracking a user and their events. It's useful for scenarios where you need to clear user session data or switch between projects on the same device. ```html blitz('logout'); ``` ```javascript blitz.logout(); ``` -------------------------------- ### Trigger Survey with Event Properties Source: https://documentation.blitzllama.com/sdk/ios Triggers a survey while passing custom event properties. These properties can be used for more precise filtering and understanding user context within the Blitzllama dashboard. ```swift // Define your event properties let eventProperties: [String: Any] = [ "eventKey1": "eventValue1", "eventKey2": "eventValue2" ] // Trigger the survey with the event properties BlitzLlamaSDKController.getSDKManager().fetchSurvey(triggerName: "triggerName", properties: eventProperties) ```