segmentio/analytics.js-integrations — pull request #167 by dpolivy (2014-05-30 21:53:48+00:00)
Title: Improve Quantcast label support

This commit adds the following improvements to the Quantcast label
support:

- add `labels` option, which, when defined, is a string of
comma-separated labels to be sent with EACH tracking ping.
- add `includeDefaultLabels` option (default: true) which, when set,
will include the default label hierarchy for all events (e.g. page.name
or event.name). If set to false, these default labels will be omitted.
- Fix issue where label was set to “page.” when no page name was
provided. In this scenario, no default label will be emitted if there
is no additional event metadata (e.g. page or event name).

Tests have been updated and improved accordingly. Overall, these
changes should make the labels mechanism more flexible for those using
the Quantcast integration.

While the first two changes are additional functionality, the third does change the behavior as it exists today -- however based on the fact that no tests actually caught this scenario, my assumption is that the behavior was an oversight. One other option, instead of omitting the label completely, is to emit just the tracking event type (page/event) without the trailing period (.).

See https://github.com/segmentio/analytics.js/issues/293 and https://github.com/segmentio/analytics.js-integrations/issues/90#issuecomment-44584456 for additional context.

Hopefully you'll be able to incorporate this PR! Please let me know if you have any questions.