LogoLogo
  • Set up UserFlux
    • What is UserFlux?
  • Create an account
  • Start collecting data
  • View your data in UserFlux
  • Plan remaining implementation
  • Integration
    • Identify users
    • Send events
  • Enrich your data
  • Feature Guides
    • Insights
      • Series
      • Funnel
      • User Composition
      • Custom SQL
  • Reports
  • Segments & Computed Properties
  • Workflows
  • Destinations
  • Metrics API
  • Security
    • API Authentication
    • Trust Center
  • SDKs
    • Browser SDK
    • React SDK
    • Backend JS SDK
  • APIs
    • Profiles API
    • Events API
    • Metrics API
    • Workflow API
    • Products API
Powered by GitBook
On this page

Start collecting data

PreviousCreate an accountNextView your data in UserFlux

Last updated 1 month ago

The simplest way to start collecting data is by adding UserFlux to your website. It only takes a few minutes and will start auto capturing traffic along with location and device information about the user.

To get started, either copy the code snippet below or install the SDK:

<head>
    <!-- Your other head tag code -->
    
    <script type="module" async>
    import UserFlux from 'https://cdn.skypack.dev/@userflux/browser-js-lite'
    UserFlux.initialize('<YOUR_WRITE_KEY>', {
	autoCapture: ['all'],
	allowCookies: true,
	autoEnrich: true,
	trackSession: true,
	defaultTrackingProperties: { project: 'Landing Page' }
    })
    </script>
</head>

Make sure to add the script to the end of your head tag and replace <YOUR_WRITE_KEY> with your own API key

npm i @userflux/browser-js
import UserFlux from '@userflux/browser-js'

UserFlux.initialize('<YOUR_WRITE_KEY>', { 
    autoCapture: ['all'],
    allowCookies: true,
    autoEnrich: true,
    trackSession: true,
    defaultTrackingProperties: { project: 'Web App' }
})

You can see the full list of SDK options from this link:


This is all you need to do to start seeing some data come through into your workspace. When you're ready to add more data, you can checkout the Integration section to learn how to identify users and send custom events.

SDKs
Integration