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()