Quantcast Destination

Destination Info
Connection Modes
Device-mode Cloud-mode
Web Web
Mobile Mobile
Server Server

Getting Started

We have both web and mobile destinations with Quantcast. The two integrations are outlined below. Our Quantcast destination code is also open source on GitHub. Feel free to check it out: analytics-ios-integration-quantcast, analytics.js-integration-quantcast.

Web Destination

When you enable Quantcast for a website from the Segment web app, your changes appear in the Segment CDN in about 45 minutes, and then Analytics.js starts asynchronously loadingquant.js onto your page. This means you should remove Quantcast’s snippet from your page.

  • Quantcast will automatically start recording data. If this is the first time sending data to Quantcast it can take them up to 12 days to process your new data.

Quantcast supports the identify and track methods on our API.

Note: For Quantcast to load you must call our page method. There is a call to page in your JavaScript snippet by default, so as long as you don’t remove it Quantcast will load whenever your snippet loads!

React Native set up

The Quantcast device-mode destination SDK is only available for android in React Native.

To add the Quantcast device-mode SDK to a React Native project using Segment’s 1.5.1≤ release:

  1. Navigate to the root folder of your project, and run a yarn add @segment/analytics-react-native-quantcast-android command to add the destination SDK to your project.
  2. Add an import statement to your project, as in the example below.
    import Quantcast from '@segment/analytics-react-native-quantcast-android'
  3. In the same project file, add the destination to the using list in the await command.
    await analytics.setup('YOUR_WRITE_KEY', {
      // Add any of your Device-mode destinations. This ensures they load before continuing.
      using: Quantcast
      // ...
  4. Finally, change to your iOS development folder ( cd ios ) and run pod install.


When you call .page(), we will automatically pass the labels. See below for details.


When you call .identify() with a userId, we’ll stringify it and pass it to Quantcast. This allows you to accurately measure your audience size across multiple platforms and devices.


Our .track() method will append Quantcast labels automatically. See below for details.

Order ID

When you call .track() and include a property labeled orderId and revenue according to our spec, we will pass that along to Quantcast in the format they expect.

Order Completed

For purchase events, you should send an event called Order Completed per our spec seen here that includes properties of order_id and total in dollars (eg 16.50, representing the order total, including taxes and fees). If you don’t use a total property, you can pass revenue - and note that if you pass both as properties, total takes precedence. If available, you should also include properties of category and repeat with a value of true or false indicating whether or not the visitor is new or returning. This will cause the appropriate Quantcast custom lables to be populated properly.



When you call page, track or screen, we’ll pass the page name, event name or screen name and the category (if provided) to Quantcast as a label. The standard label will look like this “" for page or screen, and "<name>" for track events. If you enable Quantcast for advertisers then we'll send "_fp.event.<name>" to match Quantcast's internal data structures for advertisers. If you do not pass any `category` or `name` for a `.page()` call, we will fallback on Quantcast's default label.</name></name>

Here’s an example for Quantcast Advertisers:

analytics.page('Blog'); // sends label _fp.event.Blog
analytics.page(); /// sends default label _fp.event.Default

For non-advertisers:

analytics.page('Blog'); // sends label "Blog"
analytics.page(); // does not send any label

If you opt to send multiple custom labels, you can do so in a few ways. You can attach a property called label and define a custom label there or send them using the Quantcast.labels in the options object.

For advertisers:

analytics.page('Home', {
  label: 'customLabel'

// This will send label as _fp.event.Home,_fp.event.customLabel

analytics.page('Home', {}, {
  Quantcast: {
    labels: ['customLabel1', 'customLabel2']

// This will send label as _fp.event.Home,_fp.event.customLabel1,_fp.event.customLabel2

IMPORTANT: Labels cannot contain any special characters so we will strip them out!


Script unverified or undetected by third-party tool

Many times this is a limitation on the tool’s detection process, where the detector is looking for a specific HTML element on your page. Our client side analytics.js library asynchronously loads the tool’s library or pixel onto the page. As such, the detection fails.

In order to confirm that the tool’s library or pixel is actually loaded onto the page, you can open up the JavaScript console and go to the network tab when the page is loading.

Checking network tab to see if script loads

If the script isn’t loading, check that any form of ad blocker is disabled.

Mobile Destination

To enable Quantcast for a mobile app in Segment:

  • Follow the instructions on the Quantcast sheet on the destinations page for adding the packaged Quantcast SDK (a simple one-liner to add to your Podfile).
  • After you build and release to the app store, Segment automatically starts translating and sending your data to Quantcast. If this is the first time sending data to Quantcast it can take them up to 12 days to process your new data.


When you call identify with a userId, we’ll pass that to Quantcast. This allows you to accurately measure your audience size across multiple platforms and devices.


When you call track Segment automatically logs the events to Quantcast.


When you call screen Segment automatically logs an event like Viewed ABC Screen to Quantcast.

Other Features


The destination does not currently support labels. If this is important to you, let us know.


Segment lets you change these destination settings from the Segment app without having to touch any code.

Setting Description
boolean, defaults to FALSE .

By default data will be sent to Quantcast Measure, enable this option to send to Quantcast Advertise
boolean, defaults to FALSE .

When sending data for eCommerce events, Segment will also include labels corresponding to the products included in the event.
string. Only required for mobile apps. You can find your API Key in the right-hand column under Your API Key after you login to Quantcast.
string. You can find your P-Code in the right-hand column under Your P-Code after you login to Quantcast.

This page was last modified: 15 Jul 2022

Get started with Segment

Segment is the easiest way to integrate your websites & mobile apps data to over 300 analytics and growth tools.
Create free account