Google Analytics(分析)跟踪 API 包含两个全局对象:_gat
用于标准跟踪,_gaq
用于异步跟踪。这两个全局对象都包含创建跟踪器对象的方法。跟踪器对象用于跟踪您的网页,并拥有许多用于配置跟踪工作方式的方法。
本页面是 _gat
、_gaq
和跟踪器对象中所有可用方法的完整参考。
_gat 对象方法
_getTracker(account)
(已弃用)_createTracker(opt_account, opt_name)
_getTrackerByName(opt_name)
_anonymizeIp()
_gaq 对象方法
_createAsyncTracker(accountId, opt_name)
(已弃用)_getAsyncTracker(opt_name)
(已弃用)push(commandArray)
跟踪器对象的方法
_addIgnoredOrganic(newIgnoredOrganicKeyword)
_addIgnoredRef(newIgnoredReferrer)
_addItem(transactionId, sku, name, category, price, quantity)
_addOrganic(newOrganicEngine, newOrganicKeyword, opt_prepend)
_addTrans(transactionId, affiliation, total, tax, shipping, city, state, country)
_clearIgnoredOrganic()
_clearIgnoredRef()
_clearOrganic()
_cookiePathCopy(newPath)
_deleteCustomVar(index)
_getName()
_setAccount()
_getAccount()
_getClientInfo(1)
_getDetectFlash(1)
_getDetectTitle(1)
_getLinkerUrl(targetUrl, useHash)
_getLocalGifPath()
_getServiceMode()
_getVersion()
_getVisitorCustomVar(index)
_initData()
(已弃用)_link(targetUrl, useHash)
_linkByPost(formObject, useHash)
_setAllowAnchor(bool)
_setAllowHash(bool)
(已弃用)_setAllowLinker(bool)
_setCampContentKey(newCampContentKey)
_setCampMediumKey(newCampMedKey)
_setCampNameKey(newCampNameKey)
_setCampNOKey(newCampNOKey)
_setCampSourceKey(newCampSrcKey)
_setCampTermKey(newCampTermKey)
_setCampaignCookieTimeout(cookieTimeoutMillis)
_setCampaignTrack(bool)
_setClientInfo(bool)
_setCookiePath(newCookiePath)
_setCookiePersistence(milliseconds)
(已弃用)_setCookieTimeout(newDefaultTimeout)
(已弃用)_setCustomVar(index, name, value, opt_scope)
_setDetectFlash(bool)
_setDetectTitle(bool)
_setDomainName(newDomainName)
_setLocalGifPath(newLocalGifPath)
_setLocalRemoteServerMode()
_setLocalServerMode()
_setReferrerOverride(newReferrerUrl)
_setRemoteServerMode()
_setSampleRate(newRate)
_setSessionTimeout(newTimeout)
(已弃用)_setSiteSpeedSampleRate(sampleRate)
_setSessionCookieTimeout(cookieTimeoutMillis)
_setVar(newVal)
(已弃用)_setVisitorCookieTimeout(cookieTimeoutMillis)
_storeGac(bool)
_trackEvent(category, action, opt_label, opt_value, opt_noninteraction)
_trackPageLoadTime()
(已弃用)_trackPageview(opt_pageURL)
_trackSocial(network, socialAction, opt_target, opt_pagePath)
_trackTiming(category, variable, time, opt_label, opt_sampleRate)
_trackTrans()