### Install Mixpanel Go SDK Source: https://docs.mixpanel.com/docs/quickstart/connect-your-data?sdk=android Install the mixpanel-go package using go get. ```bash go get github.com/mixpanel/mixpanel-go ``` -------------------------------- ### Quick Start: Initialize and Evaluate Flags Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/swift/swift-openfeature Initialize the MixpanelOpenFeatureProvider with your project token and register it with OpenFeature. Then, get a client to evaluate boolean feature flags. ```swift import Mixpanel import MixpanelOpenFeature import OpenFeature // 1. Create and register the provider let options = MixpanelOptions(token: "YOUR_PROJECT_TOKEN") let provider = MixpanelOpenFeatureProvider(options: options) await OpenFeatureAPI.shared.setProviderAndWait(provider: provider) // 2. Get a client and evaluate flags let client = OpenFeatureAPI.shared.getClient() let showNewFeature = client.getBooleanValue(key: "new-feature-flag", defaultValue: false) if showNewFeature { print("New feature is enabled!") } ``` -------------------------------- ### Quick Start: Initialize Mixpanel and OpenFeature Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/javascript/javascript-openfeature Initialize the Mixpanel SDK with your project token and feature flag context. Then, create and register the Mixpanel OpenFeature provider with the OpenFeature SDK. Finally, get a client to evaluate boolean flags. ```typescript import mixpanel from 'mixpanel-browser'; import { OpenFeature } from '@openfeature/web-sdk'; import { MixpanelProvider } from '@mixpanel/openfeature-web-provider'; // 1. Initialize Mixpanel with feature flags mixpanel.init('YOUR_PROJECT_TOKEN', { flags: { context: { plan: 'premium' } } }); // 2. Create and register the Mixpanel provider const provider = new MixpanelProvider(mixpanel.flags); await OpenFeature.setProviderAndWait(provider); // 3. Get a client and evaluate flags const client = OpenFeature.getClient(); const showNewFeature = client.getBooleanValue('new-feature-flag', false); if (showNewFeature) { console.log('New feature is enabled!'); } ``` -------------------------------- ### Initialization and Control Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/react-native/react-native-replay This snippet demonstrates the basic setup and control flow for the React Native Session Replay SDK. It shows how to initialize the SDK with a configuration object, start and stop recording sessions, and check the current recording status. ```APIDOC ## Initialize Session Replay ### Description Initializes the Session Replay SDK with the provided Mixpanel token, distinct ID, and configuration. ### Method `MPSessionReplay.initialize(token: string, distinctId: string, config: MPSessionReplayConfig)` ### Parameters - **token** (string) - Required - Your Mixpanel project token. - **distinctId** (string) - Required - The distinct ID for the user. - **config** (MPSessionReplayConfig) - Required - Configuration object for session replay. - **wifiOnly** (boolean) - Optional - If true, recording only happens on Wi-Fi. - **recordingSessionsPercent** (number) - Optional - Percentage of sessions to record (0-100). - **autoStartRecording** (boolean) - Optional - If true, recording starts automatically. - **autoMaskedViews** (Array) - Optional - Views to automatically mask (e.g., Image, Text). - **flushInterval** (number) - Optional - Interval in seconds for flushing recorded data. - **enableLogging** (boolean) - Optional - If true, enables SDK logging. - **serverURL** (string) - Optional - Custom server URL for data submission. ### Control Recording #### Start Recording ### Method `MPSessionReplay.startRecording()` ### Description Manually starts the session recording. #### Stop Recording ### Method `MPSessionReplay.stopRecording()` ### Description Manually stops the session recording. #### Check Recording Status ### Method `MPSessionReplay.isRecording()` ### Description Checks if the session recording is currently active. ### Returns - **recording** (Promise) - A promise that resolves to true if recording, false otherwise. ``` -------------------------------- ### Install Mixpanel Swift SDK Source: https://docs.mixpanel.com/docs/quickstart/connect-your-data?sdk=ios Instructions for installing the Mixpanel Swift SDK using Carthage or CocoaPods. ```bash #Add `github "mixpanel/mixpanel-swift"` to your Cartfile. ``` ```bash #Create a Podfile in your Xcode project directory by running `pod init` in your terminal, edit the Podfile generated, and add the following line: `pod 'Mixpanel-swift'`. #Run `pod install` in your Xcode project directory. CocoaPods should download and install the Mixpanel library, and create a new Xcode workspace. Open up this workspace in Xcode or typing `open *.xcworkspace` in your terminal. ``` -------------------------------- ### Install Mixpanel Go SDK Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/go/go-flags Install the Mixpanel Go SDK to version v2.0.0 or later. Ensure you are on an Enterprise subscription plan. ```bash go get github.com/mixpanel/mixpanel-go@v2.0.0 ``` -------------------------------- ### Install Mixpanel Swift SDK Source: https://docs.mixpanel.com/docs/quickstart/connect-your-data?sdk=httpapi Instructions for installing the Mixpanel Swift SDK using Swift Package Manager, CocoaPods, or Carthage. ```bash pod 'Mixpanel-swift' ``` ```bash github "mixpanel/mixpanel-swift" ``` -------------------------------- ### Install Mixpanel Ruby SDK Source: https://docs.mixpanel.com/docs/quickstart/connect-your-data?sdk=android Install the Mixpanel Ruby SDK using the gem command. ```ruby gem install mixpanel-ruby ``` -------------------------------- ### Install OpenFeature Provider for Go Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/go/go-openfeature Install the Mixpanel Go OpenFeature provider and the OpenFeature Go SDK. Ensure you have an Enterprise subscription with Feature Flags enabled and a Project Token. ```bash go get github.com/mixpanel/mixpanel-go/openfeature go get github.com/open-feature/go-sdk ``` -------------------------------- ### Install Mixpanel Ruby SDK Source: https://docs.mixpanel.com/docs/quickstart/connect-your-data?sdk=javascript Install the Mixpanel Ruby SDK using the gem command. ```ruby gem install mixpanel-ruby ``` -------------------------------- ### Install Mixpanel Objective-C SDK Source: https://docs.mixpanel.com/docs/quickstart/connect-your-data?sdk=ios Instructions for installing the Mixpanel SDK for Objective-C using Carthage or CocoaPods. ```bash #Add `github "mixpanel/mixpanel-iphone"` to your Cartfile. ``` ```bash #Create a Podfile in your Xcode project directory by running `pod init` in your terminal, edit the Podfile generated, and add the following line: `pod 'Mixpanel'`. #Run `pod install` in your Xcode project directory. CocoaPods should download and install the Mixpanel library, and create a new Xcode workspace. Open up this workspace in Xcode or typing `open *.xcworkspace` in your terminal. ``` -------------------------------- ### Install Mixpanel Objective-C SDK Source: https://docs.mixpanel.com/docs/quickstart/connect-your-data?sdk=android Instructions for installing the Mixpanel Objective-C SDK via Swift Package Manager, Cocoapods, or Carthage. ```bash pod init ``` ```bash pod install ``` -------------------------------- ### Install Mixpanel Library Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/ios Install the Mixpanel library and create an Xcode workspace using CocoaPods. ```bash pod install ``` -------------------------------- ### Install Mixpanel OpenFeature Provider Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/python/python-openfeature Install the necessary packages for the Mixpanel OpenFeature provider and the OpenFeature SDK. ```bash pip install mixpanel-openfeature openfeature-sdk ``` -------------------------------- ### Install Mixpanel Browser SDK via yarn Source: https://docs.mixpanel.com/docs/quickstart/connect-your-data?sdk=android Install the mixpanel-browser package using yarn. ```bash yarn add mixpanel-browser ``` -------------------------------- ### Start Session Replay Recording with Sampling Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/android/android-replay Programmatically start recording replay data with a specified sampling percentage. This overrides the `recordingSessionsPercent` set in the configuration. Recording starts regardless of the configured sampling rate. ```kotlin MPSessionReplay.getInstance()?.startRecording(sessionsPercent = 10.0) ``` -------------------------------- ### Install Mixpanel Python SDK Source: https://docs.mixpanel.com/docs/quickstart/connect-your-data?sdk=android Install the Mixpanel Python library using pip. ```bash pip install mixpanel ``` -------------------------------- ### Install OpenFeature Provider and SDKs Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/javascript/javascript-openfeature Install the necessary packages for the Mixpanel OpenFeature provider, the OpenFeature web SDK, and the Mixpanel browser SDK using npm. ```bash npm install @mixpanel/openfeature-web-provider @openfeature/web-sdk mixpanel-browser ``` -------------------------------- ### Install Mixpanel JS SDK via NPM or Yarn Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/javascript Install the `mixpanel-browser` package using npm or yarn. After installation, import the Mixpanel class and initialize it with your project token and configuration. ```bash # via npm npm install --save mixpanel-browser # via yarn yarn add mixpanel-browser ``` ```javascript // import mixpanel class from the library import mixpanel from 'mixpanel-browser' // create an instance Mixpanel object using your project token mixpanel.init("YOUR_PROJECT_TOKEN", { autocapture: true, track_pageview: true, record_sessions_percent: 100, //records 100% of all sessions record_heatmap_data: true, }); ``` -------------------------------- ### Install OpenFeature Provider for Node.js Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/nodejs/nodejs-openfeature Install the necessary packages for the Mixpanel OpenFeature server provider and the OpenFeature SDK. ```bash npm install @mixpanel/openfeature-server-provider @openfeature/server-sdk mixpanel ``` -------------------------------- ### Install Mixpanel Browser SDK via npm Source: https://docs.mixpanel.com/docs/quickstart/connect-your-data?sdk=android Install the mixpanel-browser package using npm. ```bash npm install --save mixpanel-browser ``` -------------------------------- ### Install Mixpanel JavaScript SDK Source: https://docs.mixpanel.com/docs/quickstart/connect-your-data?sdk=android Paste this script tag before your closing tag to load the Mixpanel JavaScript SDK. Alternatively, use npm or yarn for installation. ```html ``` -------------------------------- ### Start Recording Replay Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/android/android-replay Programmatically start capturing replay data. You can optionally specify a sampling percentage. ```APIDOC ## startRecording() ### Description Starts capturing replay data. Recording begins regardless of the `recordingSessionsPercent` configuration. You may optionally specify a sampling percentage. ### Method `MPSessionReplay.getInstance()?.startRecording(sessionsPercent: Double?)` ### Parameters #### Path Parameters - **sessionsPercent** (Double) - Optional - The percentage of sessions to record, between 0.0 and 100.0. If not provided, the percentage set in `MPSessionReplayConfig` is used. ### Request Example ```kotlin theme="system" // start recording with a specified sampling rate (10%) MPSessionReplay.getInstance()?.startRecording(sessionsPercent = 10.0) // start recording using the configured sampling rate MPSessionReplay.getInstance()?.startRecording() ``` ### Notes - `.startRecording()` will have no effect if recording is already in progress. - Recording automatically stops when the app goes into the background. If `autoStartRecording` is true, recording will automatically start when the app returns to the foreground. ``` -------------------------------- ### Install Mixpanel iOS SDK (Swift) Source: https://docs.mixpanel.com/docs/quickstart/connect-your-data?sdk=javascript Instructions for installing the Mixpanel Swift SDK using Swift Package Manager, Cocoapods, or Carthage. ```swift import Mixpanel func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { ... // Replace with your Project Token Mixpanel.initialize(token: "YOUR_TOKEN", trackAutomaticEvents: false) ... } ``` -------------------------------- ### Install React Native Session Replay SDK with npm Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/react-native/react-native-replay Use npm to install the SDK. Ensure your React Native version is 0.70 or higher. ```bash npm install @mixpanel/react-native-session-replay ``` -------------------------------- ### Install Mixpanel Flutter SDK Source: https://docs.mixpanel.com/docs/quickstart/connect-your-data?sdk=android Add the mixpanel_flutter dependency to your pubspec.yaml and run flutter pub get. ```yaml flutter pub get ``` -------------------------------- ### Install Mixpanel Flutter SDK Source: https://docs.mixpanel.com/docs/quickstart/connect-your-data?sdk=javascript Add the mixpanel_flutter dependency to your pubspec.yaml file and run flutter pub get. ```yaml flutter pub get ``` -------------------------------- ### Initializing Mixpanel with Network Recording Options Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/javascript/javascript-replay Example of initializing the Mixpanel SDK with custom network recording configurations. ```APIDOC ## Initialize Mixpanel with Network Recording Options ### Description This example demonstrates how to initialize the Mixpanel JavaScript SDK and configure advanced network recording options. ### Method `mixpanel.init(token, config)` ### Parameters - `token` (string): Your Mixpanel project token. - `config` (object): Configuration object for the SDK. - `record_sessions_percent` (number): Percentage of sessions to record. - `record_network` (boolean): Enable network recording. - `record_network_options` (object): Options to customize network recording. - `initiatorTypes` (InitiatorType[]): Resource types to capture (e.g., `fetch`, `xmlhttprequest`). - `ignoreRequestUrls` (string[]): URL patterns to exclude from recording. - `ignoreRequestFn` ((data: NetworkRequest) => boolean): Custom function to filter requests. - `recordHeaders` ({ request: string[], response: string[] }): Allowlist of headers to record. - `recordBodyUrls` ({ request: string[], response: string[] }): URL patterns for which to record request/response bodies. - `recordInitialRequests` (boolean): Capture requests that occurred before recording started. ### Request Example ```javascript mixpanel.init('YOUR_PROJECT_TOKEN', { record_sessions_percent: 100, record_network: true, record_network_options: { initiatorTypes: ['fetch', 'xmlhttprequest'], ignoreRequestUrls: ['https://api.example.com/health'], ignoreRequestFn: function(data) { return data.url.includes('/internal/'); }, recordHeaders: { request: ['content-type', 'authorization'], response: ['content-type', 'x-request-id'] }, recordBodyUrls: { request: ['https://api.example.com/submit'], response: ['https://api.example.com/submit'] }, recordInitialRequests: true } }); ``` ``` -------------------------------- ### Initialize Session Replay SDK Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/android/android-replay Initialize the MPSessionReplay SDK in your Application class after ensuring the main Mixpanel Android SDK is installed. This example shows basic initialization with custom configuration. ```kotlin private fun initializeMixpanel() { val token = "MY_PROJECT_TOKEN" val trackAutomaticEvents = true val mixpanel = MixpanelAPI.getInstance(this, token, trackAutomaticEvents) mixpanel.identify("DISTINCT_ID") val config = MPSessionReplayConfig( wifiOnly = false, enableLogging = true ) MPSessionReplay.initialize(this, token, mixpanel.distinctId, config) } ``` -------------------------------- ### Example Params for JQL Query Source: https://docs.mixpanel.com/docs/reports/apps/jql Define parameters like start date, end date, and event name to be used in JQL queries. This allows for dynamic query execution based on provided inputs. ```javascript params = { start_date: "2016-01-01", end_date: "2016-01-10", event: "View Blog" } ``` -------------------------------- ### Quick Start: Mixpanel Go OpenFeature Provider Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/go/go-openfeature Initialize the Mixpanel OpenFeature provider with local evaluation, register it with the OpenFeature SDK, and evaluate a boolean flag. Replace 'YOUR_PROJECT_TOKEN' with your actual Mixpanel Project Token. ```go package main import ( "context" "fmt" mixpanelopenfeature "github.com/mixpanel/mixpanel-go/openfeature" "github.com/mixpanel/mixpanel-go/v2/flags" of "github.com/open-feature/go-sdk/openfeature" ) func main() { // 1. Create the Mixpanel OpenFeature provider with local evaluation provider, err := mixpanelopenfeature.NewProviderWithLocalConfig("YOUR_PROJECT_TOKEN", flags.LocalFlagsConfig{}) if err != nil { panic(err) } // 2. Register the provider with OpenFeature of.SetProvider(provider) client := of.NewClient("my-app") // 3. Evaluate flags showNewFeature, _ := client.BooleanValue(context.Background(), "new-feature-flag", false, of.EvaluationContext{}) if showNewFeature { fmt.Println("New feature is enabled!") } } ``` -------------------------------- ### Configure Mixpanel Go SDK Source: https://docs.mixpanel.com/docs/quickstart/connect-your-data?sdk=android Create a background context and initialize the Mixpanel API client with your project token. ```go package main import ( "context" "github.com/mixpanel/mixpanel-go" ) func main() { ctx := context.Background() pm := mixpanel.NewApiClient("YOUR_TOKEN") } ``` -------------------------------- ### Install Mixpanel React Native SDK Source: https://docs.mixpanel.com/docs/quickstart/connect-your-data?sdk=javascript Install the mixpanel-react-native package using npm and run pod install for iOS. ```bash npm install mixpanel-react-native ``` ```bash pod install ``` -------------------------------- ### Install Pods for iOS Native Apps Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/react-native/react-native-flags After installing the beta SDK for React Native, navigate to the iOS directory and install the necessary pods. ```bash cd ios && pod install ``` -------------------------------- ### Install Mixpanel React Native SDK Source: https://docs.mixpanel.com/docs/quickstart/connect-your-data?sdk=android Install the Mixpanel React Native SDK using npm and run pod install for iOS. ```bash npm install mixpanel-react-native ``` ```bash pod install ``` -------------------------------- ### Install Mixpanel Ruby OpenFeature Provider Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/ruby/ruby-openfeature Add the necessary gems to your Gemfile for the Mixpanel Ruby OpenFeature provider and OpenFeature SDK. Run `bundle install` to install them. ```ruby gem 'mixpanel-ruby-openfeature' gem 'openfeature-sdk' gem 'mixpanel-ruby' ``` -------------------------------- ### Quick Start: Initialize and Evaluate Flags Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/java/java-openfeature Initialize the Mixpanel OpenFeature provider with your project token and local configuration. Then, obtain a client to evaluate boolean feature flags. ```java import com.mixpanel.openfeature.MixpanelProvider; import com.mixpanel.mixpanelapi.featureflags.config.LocalFlagsConfig; import dev.openfeature.sdk.OpenFeatureAPI; import dev.openfeature.sdk.Client; // 1. Create and register the provider with local evaluation MixpanelProvider provider = new MixpanelProvider( "YOUR_PROJECT_TOKEN", new LocalFlagsConfig("YOUR_PROJECT_TOKEN") ); OpenFeatureAPI api = OpenFeatureAPI.getInstance(); api.setProvider(provider); // 2. Get a client and evaluate flags Client client = api.getClient(); boolean showNewFeature = client.getBooleanValue("new-feature-flag", false); if (showNewFeature) { System.out.println("New feature is enabled!"); } ``` -------------------------------- ### Install CocoaPods Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/ios Install CocoaPods using the RubyGems package manager. ```bash gem install cocoapods ``` -------------------------------- ### Install Mixpanel Node.js SDK Source: https://docs.mixpanel.com/docs/quickstart/connect-your-data?sdk=android Install the mixpanel package for Node.js using npm. ```bash npm install mixpanel ``` -------------------------------- ### Quick Start: Initialize and Evaluate Flags Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/python/python-openfeature Initialize the Mixpanel OpenFeature provider with your project token and local configuration, then register it with the OpenFeature API. Use the client to evaluate boolean feature flags. ```python from mixpanel_openfeature import MixpanelProvider from mixpanel.flags.types import LocalFlagsConfig from openfeature import api # 1. Create and register the provider with local evaluation provider = MixpanelProvider.from_local_config( "YOUR_PROJECT_TOKEN", LocalFlagsConfig(token="YOUR_PROJECT_TOKEN"), ) api.set_provider(provider) # 2. Get a client and evaluate flags client = api.get_client() show_new_feature = client.get_boolean_value("new-feature-flag", False) if show_new_feature: print("New feature is enabled!") ``` -------------------------------- ### Initialize Mixpanel SDK Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/react-native Import the Mixpanel class, create an instance with your project token, and initialize the SDK. Automatic event tracking can be disabled. ```javascript //import Mixpanel class from the SDK import { Mixpanel } from 'mixpanel-react-native'; // create an instance of Mixpanel using your project token // disable legacy autotrack mobile events const trackAutomaticEvents = false; const mixpanel = new Mixpanel('YOUR_PROJECT_TOKEN', trackAutomaticEvents); //initialize Mixpanel mixpanel.init(); ``` -------------------------------- ### Install Mixpanel Dependency Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/flutter Run this command in your terminal to install the packages listed in your pubspec.yaml file. ```bash # install packages in your dependencies $ flutter pub get ``` -------------------------------- ### startRecording Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/react-native/react-native-replay Starts the session recording process, capturing user interactions within the application. ```APIDOC ## startRecording ### Description Start recording user interactions. ### Method Signature ```typescript startRecording(): Promise ``` ### Example ```typescript await MPSessionReplay.startRecording(); ``` ``` -------------------------------- ### Track an Event in Go Source: https://docs.mixpanel.com/docs/quickstart/capture-events/track-events Create and track a 'Sign Up' event with properties using the Go SDK. Ensure the context and user ID are correctly provided. ```go exampleEvent = mp.NewEvent("Sign Up", "USER_ID", map[string]any{ "Signup Type": "Referral", }) err := mp.Track(ctx, []*mp.PeopleProperties{ exampleUser, }, ) ``` -------------------------------- ### Initialize Mixpanel SDK Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/ios Import the Mixpanel library and initialize the SDK with your project token in the application delegate. ```objc #import "Mixpanel/Mixpanel.h" - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ... //create Mixpanel instance [Mixpanel sharedInstanceWithToken:@"YOUR_PROJECT_TOKEN" trackAutomaticEvents:NO]; ... } ``` -------------------------------- ### Install CocoaPods Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/swift Installs the CocoaPods dependency manager. This is a prerequisite for using CocoaPods to manage Mixpanel dependencies. ```bash # install CocoaPods gem install cocoapods ``` -------------------------------- ### Initialize Mixpanel with Composer Source: https://docs.mixpanel.com/docs/tracking-methods/sdks/php After installing via Composer, use this PHP code to include the autoloader and create an instance of the Mixpanel class with your project token. ```php ``` -------------------------------- ### Configure Mixpanel Python SDK Source: https://docs.mixpanel.com/docs/quickstart/install-mixpanel Initialize the Mixpanel Python SDK with your project token. Replace 'YOUR_TOKEN' with your actual Mixpanel project token. ```python from mixpanel import Mixpanel mp = Mixpanel("YOUR_TOKEN") ``` -------------------------------- ### Initialize Session Replay with Basic Options Source: https://docs.mixpanel.com/docs/session-replay/implement-session-replay/session-replay-web Record 1% of sessions and set an idle timeout for replay captures. This is a basic setup for session replay. ```javascript mixpanel.init( "", { record_sessions_percent: 1, //records 1% of all sessions record_idle_timeout_ms: 1800000 //End a replay capture after 30mins of inactivity } ); ``` -------------------------------- ### Amplitude API Request Example Source: https://docs.mixpanel.com/docs/migration/amplitude This bash script demonstrates a sample server-side request to Amplitude's /track API endpoint. Ensure you replace 'YOUR_API_KEY' with your actual Amplitude API key. ```bash curl -X POST https://api2.amplitude.com/2/httpapi \ -H 'Content-Type: application/json' \ -H 'Accept: */*' \ --data '{ \ "api_key": "YOUR_API_KEY", \ "events": [{ \ "user_id": "203201202", \ "device_id": "C8F9E604-F01A-4BD9-95C6-8E5357DF265D", \ "event_type": "watch_tutorial" \ }] \ }' ```