LogoLogo
Back to studio
  • Formsort documentation
  • โฉQuickstart
    • ๐ŸŸขGet started with Formsort
    • ๐ŸŽCore concepts
    • โ„น๏ธQuestion and content reference
    • ๐Ÿ“•Key terms
    • ๐Ÿž๏ธCreate your first flow
    • ๐Ÿ“–Add content and collect answers
      • ๐ŸคณCapture demographic data
      • โ„น๏ธAdd informational content
      • ๐Ÿ” Review your variable schema
    • ๐ŸŽจCreate a theme
      • Set brand guidelines
    • ๐ŸคนPersonalize your flow
      • ๐ŸŒŸTemplate your variables
      • ๐Ÿง Add conditional logic
      • ๐Ÿ’ซUsing conditional logic with Calculated and API variables
      • ๐Ÿ”šEnd the flow
    • ๐Ÿ”€Set up integrations
    • ๐Ÿš€Go live
      • Auditing your flow for content, functionality, and design
    • ๐Ÿ’ผCommon use cases
      • ๐Ÿ’”Disqualify responders
      • ๐Ÿ—“๏ธAdd a scheduling option
      • ๐Ÿ“„Allow responders to read and accept your company policies
  • ๐Ÿ—๏ธBuilding flows
    • Flows and variants
      • Flow starts
    • Adding content
      • Groups
      • Steps
        • Settings
        • Logic
        • Style
      • Questions
        • General Settings
        • Style
        • Address
        • Comparison
        • Confirmation
        • Date
        • Date & Time
        • Email address
        • File upload
        • Grid choice
        • Iframe
        • Image upload
        • Number
        • Payment
        • Phone number
        • Postal code
        • Question group
        • Region
        • Select
          • Providing choices via API or calculation
        • Signature
        • SSN
        • Text questions
        • Yes/No
      • Content
        • General Settings
        • Statement
        • Image
        • Video
        • Next button
        • Divider
        • Map
      • Endings
      • Using markdown
      • Using variable templating
        • Template formatting functions
      • Copy-pasting form content
      • Content library
    • Conditions and logic
      • Logical operator reference
      • Advanced logic
    • Variables (answers)
      • Variables from questions
      • Externally provided variables
      • Calculated variables
      • API lookups
      • System Library variables
      • Orphaned variables
    • Schemas
      • JSON Schemas
      • Validating flow schemas
    • Redirects
    • Styling and themes
      • CSS Reference
      • Overriding theme styling
      • Custom CSS overrides
      • Content area
      • Animations and transitions
      • Form Layout
      • Typography
        • Adobe Fonts
        • Hosting custom fonts
      • Color variables
      • Dimension variables
      • Question containers
      • Assets
      • Form Buttons
        • Select buttons
      • Inputs and dropdowns
      • Checkmarks
      • Tables
      • Sliders
      • Divider lines
      • Progress bar
      • Comparison cards
    • Variant settings
      • Form behavior for returning responders
      • Group ranking API
    • Publishing and versions
      • Preview window
      • Deploying
      • History
  • ๐Ÿ’พHandling data
    • Philosophy and data retention policy
    • Viewing form answers
    • Responder UUIDs
    • Environments
      • Loading different environments
    • Passing data in
      • URL parameters
      • POST body
      • Embed query parameters
    • Custom validators
    • Form answers and events
      • Analytics events
      • Signed requests
      • Event payload shape
      • Submission frequencies
      • Runtime error reporting
      • Admin API
      • Flow content data format
    • Integration reference
      • Amplitude
        • Amplitude cross domain tracking
      • BigQuery
      • FullStory
      • Google Analytics
        • Updating from Universal Analytics to GA4
      • Google Cloud Storage
      • Google Sheets
      • Google Tag Manager (GTM)
        • JavaScript triggered by flow events
      • Hubspot
      • Jornaya
      • Optimizely
      • PostgreSQL
      • Redshift
      • Rudderstack
      • S3
      • Salesforce
      • Segment
        • Segment Setup
        • Segment cross domain tracking
      • Stripe
      • TrustedForm
      • Webhooks
        • Zapier
  • ๐Ÿ“บGoing live
    • Custom domains
    • Built-in analytics
    • Embedding
      • Web-Embed API
        • React-embed
      • Adding authentication
      • Embedding forms in iOS and Android
      • Setting up a dev environment
    • Split testing
    • Preflight checklist
  • ๐ŸขTeams
    • Accounts
      • Roles and permissions
    • Events subscriptions
    • Workspace domain detection
Powered by GitBook
On this page
  • Overview
  • Setup
  • Step 1: Enable using cross domain tracking in the Amplitude integration
  • Step 2: Pass the device id as a query parameter to responders hitting the flow

Was this helpful?

  1. Handling data
  2. Integration reference
  3. Amplitude

Amplitude cross domain tracking

Track responders in Amplitude across domains

PreviousAmplitudeNextBigQuery

Last updated 2 years ago

Was this helpful?

Overview

If you would like to track Amplitude users across multiple domains e.g:

  • Site 1: https://www.example.com

  • Site 2: https://www.flow.example.com (the domain hosting the Formsort flow)

You must explicitly pass the amplitude device id from the top level domain to the one hosting the Formsort flow. This can be done for the both with a direct link deployment or an embedded flow.

Setup

Step 1: Enable using cross domain tracking in the Amplitude integration

Navigate to the Amplitude integration and enable "Use device ID from URL parameter".

Step 2: Pass the device id as a query parameter to responders hitting the flow

Follow the . After deploying the flow in Step 1, you can now pass a device id into the flow as a parameter.

Passing via direct link

Pass the device id as a query parameter, for example this may look like:

  1. From the initial Site 1 grab the Device ID from the Amplitude SDK using amplitude.getInstance().options.deviceId.

  2. Pass the Device ID to the new Site 2 via a URL parameter when the user navigates. (e.g. https://flow.example.com/client/{{your_account_name}}/flow/{{your_flow_name}}/variant/{{your_flow_variant_name}}/?amp_device_id=device_id_from_site_1)

  3. Initialize the Amplitude SDK on Site 2 with amplitude.init('API_KEY', null, {deviceIdFromUrlParam: true}).

Passing via embed

// in the main site retrieve device id from amp instance
const ampDeviceId = amplitude.getInstance().options.deviceId;

// pass the device id to Formsort flow
<EmbedFlow
  clientLabel="client"
  flowLabel="onboarding"
  queryParams={[['amp_device_id', ampDeviceId]]}
/>
// in the main site retrieve device id from amp instance
const ampDeviceId = amplitude.getInstance().options.deviceId;

embed.loadFlow(
  'client', // client label
  'onboarding', // flow label
  'main', // variant label - optional
  [['amp_device_id', ampDeviceId]] // query params
)

Note: After initializing amplitude, Formsort flow removes device id from URL. But cross-domain tracking keeps working if user refreshes the page.

If you want to enable cross domain tracking in an embedded flow, you can pass amp_device_id via query_params in our package. e.g.

If you don't use react, you can do the same using our . e.g.

๐Ÿ’พ
react-embed
web-embed-api
official Amplitude documentation