/************************************************************************* * Copyright 2020 Adobe * All Rights Reserved. * * NOTICE: Adobe permits you to use, modify, and distribute this file in * accordance with the terms of the Adobe license agreement accompanying * it. If you have received this file from a source other than Adobe, * then your use, modification, or distribution of it requires the prior * written permission of Adobe. **************************************************************************/ /** * @packageDocumentation * @module metrics */ /** * The Analytics APIs are designed to mirror the Omega APIs, enabling an Analtyics record to be * remotely stored which simulatenously captures additional context provided by the Metrics system * at the same time that window.digitalData is sent to analytics. Two use cases are supported, * described as follows. * * For applications that provide Omega launch script configuration to the * `MetricsBrowserRuntime.init()` method, the corresponding portions of the digitalData object can * be supplied to the following APIs, and the Metrics SDK will store the provided object in * `window.digitalData`, and simultaneously record the Analytics record in remote storage and call * the Omega `window._satellite.track()` method. This approach assures consistency in the data * between Omega and Metrics. */ export default interface Analytics { /** * Complements the corresponding window._satellite.track() method and records an Analytics record. * @param type The type of event. * @param args Additional data to log. */ track(type: 'event' | 'page' | 'user', ...args: any): void; /** * Set `window.digialData.eventData` to the specified input and record an Analytics record. * @param eventData The object to assign to `window.digitalData.eventData`. */ trackEvent(eventData: Record): void; /** * Set `window.digialData.pageData` to the specified input and record an Analytics record. * @param pageData The object to assign to `window.digitalData.pageData`. */ trackPage(pageData: Record): void; /** * Set `window.digialData.userData` to the specified input and record an Analytics record. * @param userData The object to assign to `window.digitalData.userData`. */ trackUser(userData: Record): void; }