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