Quantcast Destination
Quantcast quick info
Quantcast accepts Track, Page, and Identify calls. If you reference it in the Integrations object, call it “Quantcast”.
Quantcast accepts device-mode data from both Analytics.js and mobile sources. It does not accept data in cloud-mode.
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:
- Navigate to the root folder of your project, and run a
yarn add quantcast-android
command to add the destination SDK to your project. - Add an
import
statement to your project, as in the example below.import Quantcast from '@segment/analytics-react-native-quantcast-android'
- In the same project file, add the destination to the
using
list in theawait
command.await analytics.setup('YOUR_WRITE_KEY', { // Add any of your Device-mode destinations. This ensures they load before continuing. using: Quantcast // ... })
- Finally, change to your iOS development folder (
cd ios
) and runpod install
.
Page
When you call .page()
, we will automatically pass the labels. See below for details.
Identify
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.
Track
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.
Features
Labels
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 “
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!
Troubleshooting
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.
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.
Identify
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.
Track
When you call track
Segment automatically logs the events to Quantcast.
Screen
When you call screen
Segment automatically logs an event like Viewed ABC Screen
to Quantcast.
Other Features
Labels
The destination does not currently support labels. If this is important to you, let us know.
Supported Sources and Connection Modes
Before you start, make sure Quantcast supports the source type and connection mode you’ve chosen to implement. You can learn more about connection modes here.
Web | Mobile | Server | |
---|---|---|---|
📱 Device-mode | ✅ | ✅ | ⬜️ |
☁️ Cloud-mode | ⬜️ | ⬜️ | ⬜️ |
This destination requires that you use a Device-based Connection Mode for Mobile data. Make sure you package the Quantcast mobile SDK with the Segment mobile library.
Settings
Segment lets you change these destination settings from the Segment app without having to touch any code.
API Key
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.
Advertise
By default data will be sent to Quantcast Measure, enable this option to send to Quantcast Advertise
Advertise Products
When sending data for eCommerce events, Segment will also include labels corresponding to the products included in the event.
P-Code
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: 23 Mar 2021
Need support?
Questions? Problems? Need more info? Contact us, and we can help!