API theo dõi của Google Analytics bao gồm hai đối tượng chung; _gat
cho theo dõi chuẩn và _gaq
cho theo dõi không đồng bộ. Cả hai đối tượng chung này đều chứa phương thức để tạo đối tượng trình theo dõi. Đối tượng công cụ theo dõi được dùng để theo dõi các trang của bạn và có nhiều phương pháp để định cấu hình cách hoạt động của tính năng theo dõi.
Trang này là tài liệu tham khảo đầy đủ về mọi phương thức có trong _gat
, _gaq
và các đối tượng trình theo dõi.
_gat Phương thức đối tượng
_getTracker(account)
không dùng nữa_createTracker(opt_account, opt_name)
_getTrackerByName(opt_name)
_anonymizeIp()
_gaq Phương thức đối tượng
_createAsyncTracker(accountId, opt_name)
không dùng nữa_getAsyncTracker(opt_name)
không dùng nữapush(commandArray)
Phương thức đối tượng của trình theo dõi
_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()
không dùng nữa_link(targetUrl, useHash)
_linkByPost(formObject, useHash)
_setAllowAnchor(bool)
_setAllowHash(bool)
không dùng nữa_setAllowLinker(bool)
_setCampContentKey(newCampContentKey)
_setCampMediumKey(newCampMedKey)
_setCampNameKey(newCampNameKey)
_setCampNOKey(newCampNOKey)
_setCampSourceKey(newCampSrcKey)
_setCampTermKey(newCampTermKey)
_setCampaignCookieTimeout(cookieTimeoutMillis)
_setCampaignTrack(bool)
_setClientInfo(bool)
_setCookiePath(newCookiePath)
_setCookiePersistence(milliseconds)
không dùng nữa_setCookieTimeout(newDefaultTimeout)
không dùng nữa_setCustomVar(index, name, value, opt_scope)
_setDetectFlash(bool)
_setDetectTitle(bool)
_setDomainName(newDomainName)
_setLocalGifPath(newLocalGifPath)
_setLocalRemoteServerMode()
_setLocalServerMode()
_setReferrerOverride(newReferrerUrl)
_setRemoteServerMode()
_setSampleRate(newRate)
_setSessionTimeout(newTimeout)
không dùng nữa_setSiteSpeedSampleRate(sampleRate)
_setSessionCookieTimeout(cookieTimeoutMillis)
_setVar(newVal)
không dùng nữa_setVisitorCookieTimeout(cookieTimeoutMillis)
_storeGac(bool)
_trackEvent(category, action, opt_label, opt_value, opt_noninteraction)
_trackPageLoadTime()
không dùng nữa_trackPageview(opt_pageURL)
_trackSocial(network, socialAction, opt_target, opt_pagePath)
_trackTiming(category, variable, time, opt_label, opt_sampleRate)
_trackTrans()