Namespace

stat_ga

stat_ga

Plugin for Google Analytics Mirroring

Properties:
Name Type Description
active boolean

Activate/Deactivate GA Mirroring Plugin

inlist Array

List of authorized GA Properties for mirroring. If empty:no restriction.

exlist Array

List of unauthorized GA Properties for mirroring. If empty:no restriction.

Members

static category

Event category default naming controller

Properties:
Name Type Description
def string

Default Category name when not provided (default:'Link')

std object

Standard Categories: kept as is when mirrored

app object

Standard Applications

static cdim

Custom Dimension Index controller

Properties:
Name Type Description
origin string

Index of Origin Custom Dimension (default:'2')

atiTag string

Index of ATI Tag Custom Dimension (default:'3')

atiL2 string

Index of ATI Level 2 Custom Dimension (default:'4')

userCat string

Index of User Category Custom Dimension (default:'5')

userID string

Index of User ID Custom Dimension (default:'6')

Example
// Change default custom dimension index and add a mapping for Site Custom Variable #10 and Page Custom Variable #2
stat_ga.cdim = {origin:'10', atiTag:'11', atiL2:'12', userCat:'13', userID:'14', x10:'16', f2:'17'}

static group

Content Grouping controller
List of L2:'Name'

static timing

Timing sampling controller
Allow controlling the time sampling, accordingly to the traffic, in order to avoid reaching free GA hits limit.
List of UA-xxxxx:yy, with yy <=10

Methods

static addProduct()

Add product to cart

static categorizeEvent()

Event manager: Refine categorization

static create(ua, dclick)

Tracker: Create

Parameters:
Name Type Description
ua string

UA-XXXXXX Property

dclick boolean

Display Advertiser features ?

static customAfterPageView()

Entry point after Page View tag

static customBeforeEvent(lname, type, node, e)

Entry point before Event raising.
Can be use to enrich upcoming event with additional data, like product add to cart.
By Default: does nothing.

Parameters:
Name Type Description
lname string

ATI Click Tag Name

type string

ATI Click Type

node object

Considered node

e object

HTML event

Example
stat_ga.customBeforeEvent=function()
{
    if (lname.indexOf('product-cart')>0 || lname.indexOf('product-comparator')>0)
    {
        var fromRange=(getXtChapter(lname, 2).indexOf('AddTo|product-')===0), data={};
        data.list=fromRange?"Range":"Detail"; // List origin for Cart addition
        stat_ga.productAction('add', getXtChapter(lname, 1), getXtChapter(lname, 2), getPageMetaContent('range-id'), getPageMetaContent('range-name'), data);
    }
}

static customBeforePageView()

Allows preparing a context before sending Page View tag

Example
stat_ga.customBeforePageView=function()
{
    // Change the Content group 1 (Section) for Level2 '13'
    stat_ga.group[13]={index:'1',name:'Errors'};
}   

static customMakeEvent(evt, lname, type, node, e)

Event structuration controller.
Can be used to customize event naming convention.
By default, call stat_ga.categorizeEvent

Parameters:
Name Type Description
evt object

GA event, as prepared by Mirroring engine before Categorization

lname string

ATI Click Tag Name

type string

ATI Click Type

node object

Considered node

e object

HTML event

Example
stat_ga.customMakeEvent=function()
{
    if (evt.eventAction==='GuidedSearch')
    {        
        evt=stat_ga.makeEvent('Global Search', evt.eventAction, lname.split('::')[1]);
    }
    return stat_ga.categorizeEvent(evt, type) ;
}  

static gt(f) → {object}

Tracker: Get tracker function

Parameters:
Name Type Description
f string

function name

GA Tracker to be used with GA APIs

object

static initProducts()

Product list initialization

static loadOrder()

Load saved Order

static loadProducts()

Load saved cart

static makeEvent()

Event manager: Build an event object

static nodeEvent()

Event manager: Prepare event data from node and ATI values

static onAfterPageview()

Page Tag: post sending actions

static onBeforePageview()

Page Tag: Prepare with customization

static onCustomCampaignATI()

Control Campaigns Mirroring GA => ATI

static onCustomCampaignGA()

Control Campaigns Mirroring ATI => GA

static onCustomPageDimensions()

Allows additional Custom Dimensions

static onYoutube()

YouTube events manager

static productAction()

Enhanced eCommerce: Product Action

static productDetail()

Enhanced eCommerce: Product Detail View

static productImpression()

Enhanced eCommerce: Product Impression

static raiseClickTag()

Event manager: Prepare and Send event

static raisePageTag()

Page Tag: Prepare without customization,and Send.

static raisePageview()

Page Tag: Send

static require(s)

General Settings: Require GA feature

Parameters:
Name Type Description
s string

feature symbole (example: 'ec' to require eCommerce)

static saveOrder()

Temporarily save Order content

static saveProducts()

Temporarily save cart content

static sendEvent()

Event manager: Send Event

General Settings: Activate Auto Linking

Parameters:
Name Type Description
ad Array

Array of domains to be autolinked

static setCampaign(forATIopt)

Page Settings : Campaign failovers

Parameters:
Name Type Attributes Description
forATI boolean <optional>

true if the failover is run to complete ATI

static setCheckout()

Complete Checkout step

static setContentGroup(index, gname)

Page Settings: Fulfill Content Group value

Parameters:
Name Type Description
index Number

Content Group index

gname string

Group name

static setDimension(index, value)

General Settings: Set Custom Dimension value

Parameters:
Name Type Description
index Number

Custom Dimension Index

value string

Custom Dimension Value

static setEC()

Enhanced eCommerce: Activate

static setEComAction()

Complete Action

static setPage(path)

Page Settings: Change Path recorded by GA

Parameters:
Name Type Description
path string

Changed Path

static setPageDimensions(lname)

Page Settings: Associate page dimensions to incoming pageview tag

Parameters:
Name Type Description
lname string

Pageview name

static setPurchase()

Complete Purchase

static setSearchKeyword(param, keyword)

Page Settings: Set Search Keyword as virtual parameter

Parameters:
Name Type Description
param string

URL virtual parameter

keyword string

Searched Keyword

static youtube(e)

Video Event manager: Event triggered on each video status change

Parameters:
Name Type Description
e object

Youtube event