Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

Quantcast Destination


Destination Info
  • Accepts Page, Identify and Track calls.
  • Refer to it as Quantcast in the Integrations object
Connection Modes
Device-modeCloud-mode
Web Web
Mobile Mobile
Server Server

Getting Started

getting-started page anchor

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(link takes you to an external page), analytics.js-integration-quantcast(link takes you to an external page).


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!

Page

page page anchor

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

order-id page anchor

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.

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 "<title>" 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.

Here's an example for Quantcast Advertisers:

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

For non-advertisers:

1
analytics.page('Blog'); // sends label "Blog"
2
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:

1
analytics.page('Home', {
2
label: 'customLabel'
3
});
4
5
// This will send label as _fp.event.Home,_fp.event.customLabel
6
7
analytics.page('Home', {}, {
8
Quantcast: {
9
labels: ['customLabel1', 'customLabel2']
10
}
11
});
12
13
// 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

script-unverified-or-undetected-by-third-party-tool page anchor

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.


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.

The destination does not currently support labels. If this is important to you, let us know(link takes you to an external page).


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

Property nameTypeRequiredDescription
Advertiseboolean

Optional

By default data will be sent to Quantcast Measure, enable this option to send to Quantcast Advertise

Default: false

Advertise Productsboolean

Optional

When sending data for eCommerce events, Segment will also include labels corresponding to the products included in the event.

Default: false

API Keystring

Optional

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(link takes you to an external page).


P-Codestring

Optional

You can find your P-Code in the right-hand column under Your P-Code after you login to Quantcast(link takes you to an external page).