Mixpanel Analytics

Wix CLI

Mixpanel Analytics

Wix CLI
This template is built with:
This CLI app template showcases Mixpanel integration, utilizing the Wix Dashboard SDK and Embedded Script to embed Mixpanel's tracking code directly onto a site. It's a great first step for developers looking to build applications focused on data-driven decision-making, user behavior analysis, or enhancing user experience.

Quick Start

Follow these instructions to quickly create and test an app based on this template.

Prerequisites

Before getting started, make sure you have the following set up:

Step 1 | Create a new app project with the Mixpanel Analytics template

Run the following command to create a new app project using this template:

npm create @wix/app@latest -- --template c442b755-2276-4336-918a-915865a9fa2b

In the creation process, you will be asked for:

  • A Wix app name. This is the name that appears for your app in the Wix Dev Center.
  • A test site to install your app on. You can select an existing site or create a new development site.
  • A package name. This is the name of the package created locally for your project, and the name of the directory containing your project’s local files.

This creates an app for you in the Wix Dev Center with the required permissions pre-configured.

Step 2 | Test the app

The app creation process installs the app on your chosen development site. However, there is still some configuration required before your app will function.

Set up a local development environment

You won’t see the app extensions on your development site until you build the app and release a version. To test the app during development, set up a local development environment using the following command.

npm run dev

This will prompt you with the following CLI menu:

View your local changes: (Press a key to open)
  ›  S  - Site (publish the site to enable site preview)
  ›  D  - Dashboard  - /

Type D to open a browser window with a preview of the app's dashboard page.

The development environment is set up for hot reloading, so any changes you make to your code will be reflected in the browser.

Enter your Mixpanel Project Token

To complete this app's setup, you must provide a Mixpanel Project Token.

  1. Go to your chosen Mixpanel project, or create a new one.

  2. Navigate to Project Settings > Overview and find your Project Token under Access Keys. Save the token.

    Mixpanel project token

  3. Return to the app’s page in your development site dashboard. In the text field under Setup, enter the token you saved and click Activate. This will both add the token to your embedded script parameters, and inject the code for the embedded script into the DOM of your site.


Related templates

Wix CLI

Custom Products Catalog

Add or remove products via a dashboard page using Stores APIs.
Dashboard SDKStores APIWix Design System
Wix CLI

Site Popup

Design interactive popups via a dashboard page.
Embedded Script APIDashboard SDKWix Design System