/** * BrainSam is tracking script used with https://strategicaudiencemap.com service * * ```typescript * const data:any[] = [] * const brain_sam = new BrainSam(data) // initializes data container & triggers pageview event * data.push({user: {zipcode: '12345'}}) // stores data for future events * data.push({event: 'custom_event'}) //triggers custom event * ``` */ export declare class BrainSam { static pixel_url: string; data_layer: any; config: any; last_observable_value: string | undefined; interval: any; dom_content_loaded_listener: (() => void) | undefined; /** * Initializes BrainSam & processes commands in data layer (if any) * @param data commands input (array) - all commands present in array during initialization will processed immediately, push method will be proxied to BrainSam command processor * * Available commands: * - `{config: {autoview: true}}` - triggers pageview after dom is loaded (default: true) * - `{config: {sam_id: 'abcde'}}` - sets master SAM id for events * - `{config: {disable_3rd_party_cookies: true}}` - disable 3rd party cookie on dep-x.com domain * - `{config: {disable_tracking_browser_data: true}}` - disable auto-tracking browser data * - `{config: {observable: 'location'}}` - triggers pageview event of every location change (e.g with history.push) * - `{config: {observable: function() { return window.article_id }}}` - triggers pageview event of every value change * - `{event: 'custom_event', custom_data: 'aaaa'}` - triggers custom event * - `{user: {zipcode: '32423'}, page: {title: 'sfasfs'}}` - stores data id data layer for future events * * Example: * ```typescript * const data:any[] = [{config: {autoview: false}}] * const brain_sam = new BrainSam(data) // initializes data container & triggers pageview event * data.push({user: {zipcode: '12345'}}) // stores data for future events * data.push({event: 'custom_event'}) //triggers custom event * ``` */ constructor(data: any); setCookie(name: string, val: string): void; getCookie(name: string): string | undefined; cleanup(): void; /** * Executes page view event, resets current observable value (if set in config) */ pageView(): void; /** * Return observable value, `location` => window.location.href, `function` => return value */ getObservableValue(): any; /** * Run 100ms inveral detecting observable changes */ watchObservable(): void; /** * Extract & map pixel data from data layer (user -> u_, domain -> d_, session -> s_, event -> e_, page -> p_) */ getPixelData(): {}; /** * Get configuration object from data layer */ getConfig(): any; /** * Sets 1st party `dep` cookie, Extracts current page info & data layer custom params & Executes event * @param event_name event name * @param obj optional extra data to be included in pixel call * @param callback optional callback function called after pixel sucessfully loaded */ event(event_name: string, obj?: any, callback?: () => void): void; /** * Execute pixel call * @param data data to be included in pixel call * @param callback optional callback function called after pixel sucessfully loaded */ pixel(data: any, callback?: () => void): void; /** * Return or Sets 1st party `dep` cookie */ setupDepCookie(): string; }