Methods related to Script Mode analytics events. This is an advanced interface for use by web apps that do not use the plugin’s HTML rendering.
Members
-
<readonly> kind :string
-
These are the event kinds that are recognized by
API.event#track.Type:
- string
Properties:
Name Type Default Description AD_REQUESTstring ad-request Ad request. This event is automatically tracked when the ad request has been dispatched
AD_RESPONSEstring ad-response Ad response. This event is automatically tracked when the ad response is received from the ad server, with a property of response status
IMPRESSIONstring impression Ad impression. This event is automatically tracked when requestAd completes successfully. A pixel tracker may be added to the DOM.
COLLECTION_IMPRESSIONstring collection-impression Collection impression. This event is automatically tracked when requestAd completes successfully. A pixel tracker may be added to the DOM.
IMPRESSION_FAILEDstring impression-failed Impression Failed. This event is emitted when requestAd fails.
PRIMARY_CLICKstring primary-click Primary click event. Track this event when an ad is clicked. A pixel tracker image may be added to the DOM’s body element. Make sure you do not delete it.
SECONDARY_VIEWstring secondary-view Secondary page view event. Track this event when an article is displayed on screen as a result of an ad click. Do not use this event if the click came from a different web site. It is for internal links only.
DEEP_LINKstring deep-link Deep link page view event. Track this event when an article is displayed on screen as a result of a deep link from another web site.
INBOUND_VIEWstring inbound-view Inbound page view event. Track this event when an article is hosted on the CMS of the web site and is not served by MediaVoice.
CTA_CLICKstring cta-click Call-to-Action click event. Track this event when a CTA link is clicked.
CTA links can be identified by a containing SPAN or DIV with the
nativeads-ctaCSS class. This container will have adata-ctaattribute whose value MUST be used as thectaIDvalue when tracking the event.OPERATIONAL_CLICKstring operational-click Operational click event. Track this event when a hyperlink of an operational nature displayed within an ad experience has been clicked (or swiped) by a user.
Methods
-
track(options)
-
Track an event for analytics collection.
Parameters:
Name Type Description optionsobject Event options
Properties
Name Type Argument Description kindAPI.event#kind The kind of event to track. Example:
"primary-click"unitobject <optional>
Ad unit
modelobject <optional>
The Article model. Used for Deep-linking and MOAT tracking.
adtagobject <optional>
Ad tag
labelstring <optional>
Event label
hrefstring <optional>
The page URL to track. By default,
window.location.hrefwill be used.htmlElementobject <optional>
The HTML element or [jQuery][1] object that contains the ad preview. This is required for MOAT tracking with the
"impression"event. The element must be rendered and in the DOM. [1]: http://jquery.com/ctaIDstring <optional>
The ID of the Call-to-Action (CTA). This is required by the
"cta-click"event.adResponseStatusstring <optional>
The ad response status for the ad request. This is required by the
"ad-response"event.adResponseTimestring <optional>
The time spent for an ad-request. This is required by the
"ad-response"event.promoFeedIDstring <optional>
The id of the promo feed from which a deep link page view event resulted from. This is only relevant when the event
kindis a"deep-link".incomingPropertyIDstring <optional>
The property ID of the traffic referrer. This is only relevant when the event
kindis a"deep-link". Only use this when both the referring property and current property are owned by the same MediaVoice Organization.incomingPropertyLabelstring <optional>
The placement label of the traffic referrer. This is only relevant when the event
kindis a"deep-link". Only use this when both the referring property and current property are owned by the same MediaVoice Organization.errorError <optional>
An Error instance indicating the error that occurred. Should be supplied with all 'impression-failed' events.