Google Analytics Event Tracking Tutorial - Optimize Smart

文章推薦指數: 80 %
投票人數:10人

Google Analytics event tracking is an advanced feature that allows you to track a specific user's interaction/activity (link clicks, ... Home About Testimonials Services GoogleAnalytics&GTMConsulting DigitalAnalyticsTraining Blog Books DigitalAnalyticsTraining Contact GoogleAnalyticsEventTrackingTutorial SpecializedTracking LastUpdated:May24,2022 Tableofcontents  [hide]WhatisGoogleAnalyticseventtracking?WhatisaneventinGoogleAnalytics?ExamplesofeventsthatcanbetrackedviaGoogleAnalyticseventtracking:CategoriesofGoogleAnalyticsEventsWhentouseGoogleAnalyticseventtracking?Structure ofGoogleAnalyticseventsWhatisEventCategoryinGoogleAnalyticsEventTracking?WhatisEventActioninGoogleAnalyticsEventTracking?WhatisEventLabelinGoogleAnalyticsEventTracking?WhatisEventValueinGoogleAnalyticsEventTracking?GoogleAnalyticsEventTrackingBestPracticesHowtosetupeventtrackingin GoogleAnalytics?HowtomakesurethatGoogleAnalyticseventtrackingisworking?EventsOverviewreportinGoogleAnalyticsTopEventsreportinGoogleAnalyticsEventPagesreportinGoogleAnalyticsEventsFlowreportinGoogleAnalyticsEventdimensionsandmetricsHowtosetupeventsasgoalconversionsinGoogleAnalytics?SettingupGoogleAnalyticseventtracking (gtag.js)SettingupGoogleAnalyticseventtracking(analytics.js)HowtotieeventstowebpageelementsviaeventhandlersHowtoSetupEventTrackinginGoogleAnalytics4(GA4)?HowtoscaleandautomateeventtrackingviaGoogleTagManager?HowtosetupvideotrackingviaGoogleTagManager?HowtosetupscrolltrackingviaGoogleTagManager?EnhancedecommercetrackingCross-devicetracking WhatisGoogleAnalyticseventtracking? GoogleAnalyticseventtrackingisanadvancedfeaturethatallowsyoutotrackaspecificuser’sinteraction/activity(linkclicks,downloads,formsubmissionandvideoplays)withawebpageelement. WhatisaneventinGoogleAnalytics? Theuser’sinteraction/activitywithawebpageelementthatyoutrackinGoogleAnalyticsiscalledan‘event’. Followingareexamplesofwebpageelements: videogadgetpodcastimagebuttonformscrollbarexternallinklightboxAjaxcontent etc. Ausercaninteractwithawebpageelementviaamouse,keyboard,frameorform. Consequently,wecanhave: Mouseevents–Theseareusers’interactionswithamouse.Keyboardevents–Theseareusers’interactionswithakeyboard.Frameevents–Theseareusers’interactionswithaframe/iframe.Formevents–Theseareusers’interactionswithaformembeddedonawebpage. Alloftheseeventscanorcannotgeneratepageviewswhentheyoccur. ExamplesofeventsthatcanbetrackedviaGoogleAnalyticseventtracking: FollowingaretheexamplesofeventsthatcanbetrackedviaGoogleAnalyticseventtracking: DownloadingafileLoadingofAjax,JavaScriptorFlashcontentLoadingofadynamicallygeneratedwebpageLoadingofpop-ups,lightboxesLoadingofavideoonawebpageScrollingdownthepageViewingofavideoViewingvideofootageofacertainlengthClickingonavideo’splay/pause/stopbuttonInteractionwithagadgetClickingonanimageoranexternallinkAbandonmentofaformfieldLog-insSharing/printingablogpost,article,videoorimageClickingonabuttonMovementofmouse MyStep-By-StepBlueprintForLearningandMasteringEventTrackinginGoogleAnalytics GettheFREEebookonGoogleAnalyticsEventTracking(77Pages) YesIwanttheFREEebook CategoriesofGoogleAnalyticsEvents Therearetwobroadcategoriesofevents: Eventsthatgeneratepageviewswhentheyoccur.Eventsthatdonotgeneratepageviewswhentheyoccur. #1Eventsthatgeneratepageviewswhentheyoccur. Forexample,clickingonaninternallinkonawebpagegeneratesapageview. #2Eventsthatdonotgeneratepageviewswhentheyoccur. Forexample,followingusers’interactionsdonotgenerateapageviewwhentheyoccur: ClickingonanexternallinkLoadingofAjax/FlashcontentDownloadingafilePlayingavideoPausingavideoRepositiontimingwithinavideo.BufferingofavideoProgressofavideoScrollingawebpageClickingonaformbuttonInteractionwithagadgetClickingonanimageAbandonmentofaformfieldSharing/printingablogpost,articleAddingitemstoashoppingcart.Clickingonabutton,etc. WhentouseGoogleAnalyticseventtracking? BydefaultGoogleAnalytics(GA)cannottrackanyeventthatdoesnotgenerateapageviewwhenitoccurs.  Youcantracksucheventsonlythrougheventtrackingorvirtualpageviews. Theruleofthumbistotrackthosetypesofuserinteractionsusing‘eventtracking’,whicheitherdonotgenerateapageviewwhentheyoccurorarenotequivalenttoapagebeingviewed. Structure ofGoogleAnalyticsevents AneventinGoogleAnalyticsismadeupof: EventCategoryEventActionEventLabelEventValue WhatisEventCategoryinGoogleAnalyticsEventTracking? The‘eventcategory’isthenameassignedtothegroupofsimilareventsyouwanttotrack. Youcanuseanyvalueoftype‘text’asaneventcategory. Thisisbasicallytheelementtheuserinteractedwithonthewebpage,forexample,video. HowtoseethevaluesofEventCategoryinGoogleAnalytics? Ifyouhavealreadysetupeventtracking,youcanseethevaluesofthe‘eventcategory’inGoogleAnalytics by followingthebelowsteps. Step-1:LogintoyourGoogleAnalyticsaccount. Step-2:Clickonthe‘Behaviour’tabavailableontheleft-handside. Step-3:Whenyouclickonthe‘Behaviour’tab,youwillseeadrop-downlikebelow. Step-4:Select‘TopEvents’fromtheoptions. Note:GoogleAnalyticsreportseventcategoryasadimensioninitsreports. WhatisEventActioninGoogleAnalyticsEventTracking? The‘EventAction’isthenameassignedtothetypeofeventyouwanttotrackforaparticularwebpageelement. Youcanuseanyvalueoftype‘text’asaneventaction. Thisistheactiontakenbytheuseronawebpage.Forexample,videoplay,videopause,videoprogress,etc. HowtoseethevaluesofEventActioninGoogleAnalytics? Ifyouhavealreadysetupeventtracking,thenyoucanseethevaluesofthe‘eventaction’inGoogleAnalyticsbyfollowingthestepsbelow: Step-1:NavigatetoBehavior>Events>TopEventsreportsofyourGAreportingview. Step-2:Clickonthe‘EventAction’primarydimension: Note:GoogleAnalyticsreport‘eventaction’asadimensioninitsreports. Getthis70pagedetailedchecklistcontainingscreenshots,step-by-stepinstructionsandlinkstoarticles DoyouwanttosetupGoogleAnalytics4(GA4)fastandcorrectly? YesIwanttheebook WhatisEventLabelinGoogleAnalyticsEventTracking? The‘eventlabel’isthenameassignedtothewebpageelementwhoseusers’interactionyouwanttotrack. Youcanuseanyvalueoftype‘text’asaneventlabel. AnEventlabelcanbeatitleofavideo,titletagofawebpage,nameofagadget,nameofadownloadablefile,etc. HowtoseethevaluesofEventLabelinGoogleAnalytics? Ifyouhavealreadysetupeventtracking,thenyoucanseethevaluesofthe‘eventlabel’inGoogleAnalyticsbynavigatingtoBehavior>Events>TopEventsandthenclickingonthe‘EventLabel’primarydimension: Note:GoogleAnalyticsreporteventlabelasadimensioninitsreports. WhatisEventValueinGoogleAnalyticsEventTracking? The‘eventvalue’isthenumericalvalueassignedtotheeventyouwanttotrack. Youcanuseanyvalueoftype‘number’asaneventvalue.However,youcannotuseanyvalueoftype‘text’asaneventvalue. Forexample,aneventvaluecanbeanynumberthatrepresentsadownloadtime,lengthofthevideofootageplayed,orsomemonetaryvalue. HowtoseethevaluesofEventValueinGoogleAnalytics? Ifyouhavealreadysetupeventtracking,thenyoucanseethevaluesofthe‘eventlabel’inGoogleAnalyticsbynavigatingtoBehavior>Events>TopEvents: Note(1):Ifyouwanttoassignamonetaryvaluetoatrackedevent,usethe‘eventvalue’. Note(2):GoogleAnalyticsreporteventvalueasametricinitsreports. Getthis70pagedetailedchecklistcontainingscreenshots,step-by-stepinstructionsandlinkstoarticles DoyouwanttosetupGoogleAnalytics4(GA4)fastandcorrectly? YesIwanttheebook GoogleAnalyticsEventTrackingBestPractices FollowingarethebestpracticesforGoogleAnalyticseventtracking Trackthosetypesofuserinteractionsaseventsthateitherdonotgenerateapageviewwhentheyoccurorarenotequivalenttoapagebeingviewed.Donotomit‘EventAction’whilesettingupeventtrackinginGoogleAnalytics.Specifyingfieldvaluesinthecorrectorderisimportantwhenhardcodingtheeventtrackingcode.Usethecorrectdatatypeforyourfieldvalueswhilesettingupeventtracking.Follownamingconventionsforeventtracking.UseGoogleTagManagertotrackevents.Avoideventtrackingfromnegativelyimpactingyourwebsitebounceratethroughthenon-interactionevent.Avoidusing duplicate‘eventaction’namesacrosscategories.Planoutyoureventtrackingstructureinadvancebeforesettingupeventtracking. BestPractice#2:Donotomit‘EventAction’whilesettingupeventtrackinginGoogleAnalytics. Ifyouareusinganalytics.jslibrarytosetupeventtrackingthenspecifying‘eventcategory’and‘eventaction’ismandatory.Whereas,specifying‘eventlabel’and‘eventvalue’isoptional. Example: ga(‘send’,’event’,’videos’,”,’chappy’,100);//incorrectbecause‘eventaction’ismissing. ga(‘send’,’event’,”,’Play’,’chappy’,100);//incorrectbecause‘eventcategory’ismissing. ga(‘send’,’event’,’videos’,’Play’,’chappy’,100);//correct Ifyouareusingtheanalytics.jslibrarythendefaultvaluesof eventCategory,eventAction, eventLabel and eventValuefieldsis‘(notset)‘. Ifyouareusingtheglobalsitetag(gtag.js)thenspecifyingthe‘eventcategory’,‘eventlabel’,and‘eventvalue’isoptional.However,specifying‘eventaction’ismandatory. Example: gtag(‘event’,”,{‘event_category’:‘videos’,‘event_label’:‘Chappy’});//Incorrectbecause‘eventaction’ismissing. gtag(‘event’,‘Play’,{‘event_category’:‘videos’,‘event_label’:‘Chappy’});//correct Note:Ifyouareusingthegtag.jslibrary,thedefaultvalueofthe‘eventcategory’is‘engagement’andthedefaultvalueofthe‘eventlabel’is(notset). BestPractice#3:Specifyingfieldvaluesinthecorrectorderisimportantwhenhardcodingtheeventtrackingcode Considerthefollowingeventtrackingcode: ga(‘send’,{ ‘hitType’:‘event’, ‘eventCategory’:‘videos’, ‘eventAction’:‘Play’, ‘eventLabel’:‘chappy’, ‘eventValue’:100 }); Youcanalsowritethislineofcodewithoutusinganyfieldnames: ga(‘send’,’event’,’videos’,’Play’,’chappy’,100); Here,GoogleAnalyticswillautomaticallyassumethat: eventcategoryis‘videos’eventactionis‘Play’eventlabelis‘Chappy’eventvalueis100 Whenyoudonotspecifyfieldnames,youthenneedtosupplyfieldvaluesinthefollowingorder: EventCategory>EventAction>EventLabel>EventValue Sincefieldvaluesareexecutedintheorderinwhichtheyaresupplied,ifIchangetheorder,myeventtrackingwillworkdifferently,orworse,won’tworkatall. Forexample: ga(‘send’,’event’,’Play’,’videos’,’chappy’,100); Here‘Play’willbetreatedasaneventcategory,and‘videos’willbetreatedasaneventaction. Anotherexample: ga(‘send’,’event’,’Play’,’videos’,100); here100willbetreatedaseventlabelinsteadofeventvalue. Toavoidthisissue,youcanleavethe‘eventlabel’fieldempty: ga(‘send’,’event’,’Play’,’videos’,”,100); BestPractice#4:Usethecorrectdatatypeforyourfieldvalueswhilesettingupeventtracking TheeventCategory,eventActionandeventLabelfieldsacceptavalueoftypetext.Whereas,the eventValuefieldacceptsavalueoftypeinteger. Sofollowingeventtrackingcodesaregoingtocreatetrackingissues: ga(‘send’,’event’,videos,’Play’,’chappy’,100);//incorrectbecause‘eventcategory’acceptsvalueoftypetext. ga(‘send’,’event’,’videos’,’Play’,’chappy’,’100′);//incorrectbecause‘eventaction’acceptsvalueoftypeinteger. Note:Thereisnohardandfastruleregardingwhatdatayouputinto‘eventcategory’,‘eventaction’,‘eventlabel’and‘eventvalue’aslongasyouareassigningvaluesoftypetextto‘eventcategory’,‘eventaction’and‘eventlabel’andvaluesoftypeintegerto‘eventvalue’. BestPractice#5:Follownamingconventionsforeventtracking Usedescriptivenamesforeventcategories,eventactions,andeventlabels.Sothatjustbylookingatthename,ausercanunderstandwhattypeofdataisbeingcollected. Likewise,use consistentnamesforeventcategories,eventactions,andeventlabels. Soifyouareusing‘videos’asaneventcategory,thendonotuse‘video’,‘Videos’,‘VIDEOS’asaneventcategory. Otherwise,youwillcreateseveraldifferenteventcategoriesinGoogleAnalyticsthatallholdthesametypeofeventdata. Oneofthebestwaystouseconsistentnamesisbyusingonlylowercaselettersforeventcategories,eventactions,andeventlabels. BestPractice#6:UseGoogleTagManagertotrackevents. TherearetwomethodstosetupGoogleAnalyticseventtracking: #1HardcodetheGoogleAnalyticseventtrackingcodeonyourwebsitethattracksaspecificuser’sinteraction(akaevent)withawebpageelement. #2UseGoogleTagManagertotrackusers’interactionwiththewebpageelements. TheadvantageofusingGTMtotrackeventsisthatitiseasiertouseandisscalable. Soifyouwanttotrackclicksonthebuttonsacrossyourwebsiteinonegowithoutmanuallyaddingtheeventtrackingcodetoeverybutton,youcaneasilydothatviaGoogleTagManager. BestPractice#7:Avoideventtrackingfromnegativelyimpactingyourwebsitebounceratethroughnon-interactionevent The‘nonInteraction’eventisusedtodesignateaneventasinteractiveornon-interactive.Thisfieldobjectcanhaveavalueoftrueorfalse. Thedefaultvalueisfalse,whichmeans,bydefault,aneventisconsideredinteractiveandimpactsthebounceratecalculations. Ifyouwanttomakeaneventnon-interactive,soitdoesn’timpactthebounceratecalculations,thensetthenonInteractionvaluetotrue. The {‘nonInteraction’:true} isusedtodesignateaneventasnon-interactive.Youcanalsouse {‘nonInteraction’:1}todesignateaneventasnon-interactive. Example Ifyouareusingtheanalytics.jslibrary: ga(‘send’,’event’,’videos’,’Play’,’chappy’,100,{‘nonInteraction’:1}); ga(‘send’,’event’,’videos’,’Play’,’chappy’,100,{‘nonInteraction’:true}); Ifyouareusingthegtag.jslibrary: gtag(‘event’,‘Play’,{‘event_label’:‘chappy’,‘event_category’:‘videos’,‘value’:100,‘non_interaction’:1}); gtag(‘event’,‘Play’,{‘event_label’:‘chappy’,‘event_category’:‘videos’,‘value’:100,‘non_interaction’:true}); ForGoogleTagManager: BestPractice#8:Avoidusing duplicate‘eventaction’namesacrosscategories Thereisadisadvantageofusingduplicate‘eventaction’namesacrosscategories: ga(‘send’,‘event’,’videos’,‘play’,’Spiderman-2’,10); ga(‘send’,‘event’,’videos’,‘play’,’Wholetsthedogout’,10); ga(‘send’,‘event’,’videos’,‘play’,’Alienvspredator’,10); Thedisadvantageisthatuniqueactionnamesincrementtheuniqueevents. Therefore,ifauserclicksontwodifferentvideos,say‘spiderman-2’and‘Aliensvspredator’,whichhavethesameactionname‘play’,then,inthatcase,GoogleAnalyticswillreportonlyoneuniqueevent,evenwhentheuserclickedontwodifferentvideos. Actionnamesneedstobeunique: ga(‘send’,‘event’,’videos’,‘play-spiderman’,’Spiderman-2’,10); ga(‘send’,‘event’,’videos’,‘play-dog-out’,’Wholetsthedogout’,10); ga(‘send’,‘event’,’videos’,‘play-aliens-predator’,’Alienvspredator’,10); Ifyouareusingthegtag.jslibrary,thentheabovecodecanbewrittenas: gtag(‘event’,‘play-spiderman’,{‘event_category’:‘videos’,‘event_label’:‘Spiderman-2’}); gtag(‘event’,‘play-dog-out’,{‘event_category’:‘videos’,‘event_label’:‘Wholetsthedogout’}); gtag(‘event’,‘play-aliens-predator’,{‘event_category’:‘videos’,‘event_label’:‘Alienvspredator’}); BestPractice#9:Planoutyoureventrackingstructureinadvancebeforeyousetupeventtracking Beforeyouimplementeventtracking: #1 Determineinadvanceallofthewebpageelements(likevideos,gadgets,images,externallinks,etc.)youwanttotrackandthetypeofusers’interactions(akaevents)youwanttotrackforeachwebpageofyourwebsite. #2Createascalablehierarchyofeventcategories,eventactions,andeventlabels.Sothatyoudon’tneedtochangethenamesofeventcategories,eventactionsfrequently,andeventlabelstoholddifferenttypesofeventdata. #3 UseanExcelSpreadsheettodecidethenamesofallyoureventcategories,eventactions,andeventlabelsinadvance.Thenworkwithyourreportuserstomakesurethatyourhierarchyisunderstandable: MyStep-By-StepBlueprint(100+Pages)ForLearningandMasteringGTMDataLayers GetTheOnlyEbookOnGTMDataLayerEverPublished(100+pages).Learn&MasterDataLayers YesIwanttheebook Howtosetupeventtrackingin GoogleAnalytics? TosetupGoogleAnalyticseventtracking,followthestepsbelow: Step-1:Determineinadvanceallofthewebpageelements(likevideos,gadgets,images,externallinks,etc.)andthetypeofusers’interactionsyouwanttotrackforeachwebpageofyourwebsite. Step-2:Createascalablehierarchyofeventcategories,eventactions,andeventlabels.Sothatyoudon’tneedtochangethenamesofeventcategories,eventactionsfrequently,andeventlabelstoholddifferenttypesofeventdata. Step-3:UseanExcelSpreadsheettodecidethenamesofallyoureventcategories,eventactions,andeventlabelsinadvance.Thenworkwithyourreportuserstomakesurethatyourhierarchyisunderstandable. Step-4:ChooseoneofthefollowingmethodstosetupeventtrackinginGoogleAnalytics: HardcodetheGoogleAnalyticseventtrackingcodeonyourwebsitethattracksaspecificuser’sinteractionwithawebpageelement.UseGoogleTagManagertotrackusers’interactionwiththewebpageelements. EventTrackingSetupMethod#1:HardcodetheGoogleAnalyticseventtrackingcodeonyourwebsite Letussupposeyouwanttotrackclicksonadownloadbutton(embeddedonawebpageonyourwebsite)inGoogleAnalyticsviaeventtracking. Followthestepsbelow: Step-1:Navigatetothewebpage(viaGoogleChromewebbrowser),whichcontainsthebuttonyouwanttotrackviaeventtracking. Step-2:Right-clickonthebuttonandthenclickon‘Inspect’fromthedrop-downmenu: Step-3:Findyourbuttoncode.Itisgoingtolooksomethingliketheonebelow: Download Step-4:Copythebuttoncodeintoyournotepad. Step-5:CreateyourGoogleAnalyticsTrackingCodeusingthefollowingsyntax: ga(‘send’,’event’,’’,’’,’,); Forexample, ga(‘send’,‘event’,‘guides’,‘download-cro’,‘cro-beginners-guide.pdf’,10) Here,GoogleAnalyticswillautomaticallyassumethat: eventcategoryis‘guides’,eventactionis‘download-cro’eventlabelis‘cro-beginners-guide.pdf’eventvalueis10 Step-6:AddyourGoogleAnalyticsEventtrackingcodetoyourbuttoncode: Download Here,onClickisamouseeventhandler.Itexecutesamethod/function(called‘ga’)inresponsetoclickonthebutton.Thiseventhandlerisusedtotietheeventtrackingcodetothebutton. Note:Youcanalsousetheeventtrackingcodebuildertooltogenerateeventtrackingcodes. Step-7:OpenyourFTPtoolandthennavigatetothewebpage/file,whichcontainsthebuttonyouwanttotrackviaeventtracking. Step-8:Downloadthefile,openit,andreplacethebuttoncodewithyournewbuttoncode(thebuttoncodewiththeeventtrackingcode). Step-9:Uploadthefiletoyourwebserver.Thiswillreplacetheoldfilewiththenewversion. Step-10:Navigatetothewebpage(viaGoogleChromewebbrowser),whichcontainsthebuttonyouwanttotrack. Step-11:Clickonthebutton. Step-12:NavigatetoyourGoogleAnalyticsview. Step-13:Clickon‘Real-time’ontheleft-handmenu. Step-14:Clickonthe‘Events’tabunderthe‘Real-time’reports. Step-15:Ontheright-handside,under‘Activeusers’,youwillsee‘Eventcategory’and‘Eventaction’. Youshouldnowbeabletoseeyoureventcategoryandeventactionvaluesbeingreported. Ifyoudon’tseeyoureventcategoryoreventaction,youreventtrackingisnotsetupcorrectly. EventTrackingSetupMethod#2:UseGoogleTagManagertotrackusers’interactions(akaevents)withthewebpageelements. Thisistherecommendedmethodtotrackusers’interactionswithwebpageelementsasitiseasiertouseandisscalable. Soifyouwanttotrackclicksonthebuttonsacrossyourwebsiteinonegowithoutmanuallyaddingtheeventtrackingcodetoeverybutton,youcaneasilydothatviaGoogleTagManager. Letussupposeyouwanttotrackclicksondownloadbuttonsembeddedondozensofwebpagesonyourwebsiteviaeventtracking. Followthestepsbelow: Step-1:Navigatetothewebpage(viaGoogleChromewebbrowser),whichcontainsthebuttonyouwanttotrackviaeventtracking. Step-2:Right-clickonthebuttonandthenclickon‘Inspect’fromthedrop-downmenu: Step-3:Findyourbuttoncode.Itisgoingtolooksomethingliketheonebelow: Download Step-4:Notedownthe‘id’attributeofthebutton.Inourcase,itis‘checklist3‘. Note:The‘id’valuethatyouuseshouldbeunique.Ifthe‘id’attributeismissing,askyourdevelopertoaddit. Step-5:InstallGoogleTagManageronyourwebsite(ifyouhavenotalready). Step-6:LogintoyourGoogleTagManageraccount. Step-7:Clickonthe‘Triggers’linkandthenclickonthe‘New’buttontocreateanewtrigger: Step-8:Namethenewtrigger‘Checkforclicksonthedownloadbutton‘. Step-9:Clickon‘Chooseatriggertypetobeginsetup‘: Step-10:Clickon‘AllElements’: Step-11:Clickon‘SomeClicks’: Step-12:Clickon‘choosebuilt-invariable’fromthedrop-downmenu: Step-13:Select‘ClickID’: Step-14:Entertheidofyourbuttonelementinthetextboxnextto‘equals’andthenclickonthe‘Save’button: Step-15:Clickonthe‘Tags’linkandthenclickonthe‘New’buttontocreateanewtag: Step-16:Nameyournewtag‘SendclickonthebuttondownloadtoGAasevent’: Step-17:Clickon‘Chooseatagtypetobeginwith’: Step-18:Select‘GoogleAnalytics:UniversalAnalytics’asatagtype: Step-19:Select‘Event’fromthe‘TrackType’drop-downmenu: Step-20:Set‘Category’to‘guides’,‘Action’to‘download-cro’,‘Labelto‘cro-beginners-guide.pdf’,‘Value’to10and‘Non-InteractionHit’to‘True’: Step-21:Clickonthecheckbox‘Enableoverridingsettingsinthistag‘andthenenteryourGAtrackingID: Step-22:Clickonthe‘Chooseatriggertomakethistagfire…’: Step-23:Findandclickonthetrigger‘Checkforclicksonthedownloadbutton’: Step-24:Clickonthe‘Save’buttontosaveyournewtag. Step-25:Clickonthe‘Preview’buttononthetopright-handside: Whenyouclickon‘Preview’toenterpreviewmode,itopensinanewwindowwiththeStartTagAssistantandinformationabouttheGTMcontainerenteringdebugmode,asshownbelow. Step-26:EnterthewebsiteURLintheboxprovidedandclickon‘Start’. Step-27:Refreshthewebpagethatcontainsthebuttonyouwanttotrack.YoushouldnowbeabletoseetheGTMdebugconsolewindowatthebottomofthepage: Step-28:IntheGTMPreviewwindow,youwillseeascreenlikethebelowthatwillshowusthatdebugmodeisconnected.Clickon‘Continue’. Step-29:Now,navigatetothepagewhereyouhaveadownloadtrackingoptionandclickonthebutton,andyoushouldbeabletoviewthetagfiringintheconsoleasshownbelow. Ifyoudon’tseeyourtaglistedunderthe‘TagFired’section,yourtagisnotfiring,andyoudidsomethingwrongwhilesettingupyourtagortrigger. Step-30:Youcanalsovalidateifthevaluespassedintheeventsareasexpectedbyclickingonthetag,whereyouwillbeabletoseethesummaryofthetagfired. Step-31:Ifthetagisfiring,thenclickonthe‘Submit’buttononthetopright-handside: Step-32:Enter‘Addedanewtagtotrackclickson‘download’buttonsasversionnameandthenclickonthe‘Publish’button: HowtomakesurethatGoogleAnalyticseventtrackingisworking? Therearefourmethodsthroughwhichyoucanmakesurethateventtrackingisworkingasintended: Bylookingatthereal-timeeventsreport.ByusingtheOmnibugChromeextension.ByusingGoogleTagAssistant.ThroughGoogleDeveloperConsole Method#1:Bylookingatthereal-timeeventsreport. Triggertheeventyouaretracking(viaGAeventtrackingcode)andthenlookatthereal-timeeventsreporttocheckwhethertheeventdata(category,action,label)isbeingpassedtoGoogleAnalytics: Method#2:UsingOmnibugChromeextension Beforefollowingthisstep,makesureyouhavedownloadedtheOmnibugChromeextensionfromtheChromeWebstore. Triggertheeventyouaretracking(viaGAeventtrackingcode)andthenopentheOmnibugbyfollowingthecontrolcommandctrl+shift+IandclickingontheOmnibugtab. Validatetheevent’seventaction,categoryandlabelunderthe‘Events’section.  Method#3:UsingGoogleTagAssistant Triggertheeventyouaretracking(viaGAeventtrackingcode)andthenclickontheGoogleTagAssistantextensionandclickonthepropertyID.Youwillseetheeventsfiredonthepage. Now,clickontheevents,andyoucanseetheeventdetailsintheTagAssistantextensionasbelow: Method#4:ThroughGoogleDeveloperConsole Thefourthwaytoseethereal-timefiringofeventsisthroughthe‘Googledeveloperconsole’. Triggertheeventyouaretracking(viaGAeventtrackingcode)andthenlookattheGoogledeveloperconsoletocheckwhethertheeventdata(category,action,label,value)isbeingpassedtoGoogleAnalytics: Iprefertousethismethodasthedeveloperconsoleprovidesmoredetailedinformationaboutfiredeventsthanthereal-timeeventsreport. TheGoogledeveloperconsolealsoprovideserrormessagesiftheeventdoesnotfire. Thereal-timeeventsreportinGAdoesnotprovideanysuchinformation.  Soifyoureventisnotfiringandyoujustrelyonreal-timeeventsreports,youwillhaveahardtimediagnosingeventtrackingissues.  Ifyoudonotsupplyeventcategoryvaluewhilesettingupeventtracking(inthecaseofanalytics.js),thetrackedeventwillnotbecountedinthe‘Totalevents’metricandwillnotbereportedinGAeventreports. TheGoogledeveloperconsolewillalsoshowyoutheerrormessage: “Missingrequiredfield‘eventCategory’forahitoftype‘event’: Liketheeventcategory,theeventactionisalsoarequiredfield. Butunliketheeventcategory,ifyoudonotsupplytheevenactionvaluewhilesettingupeventtracking(inthecaseofanalytics.js),thenthetrackedevent(withouteventaction)willstillbecountedinthe‘Totalevents’metric. Googledeveloperconsolewillshowyoutheerrormessage: “Missingrequiredfield‘eventAction’forhitoftype‘event’: UnderstandingEventsreportsinGoogleAnalytics TherearefoureventtrackingreportsavailableinGoogleAnalytics: OverviewreportTopEventsreportPagesreportEventsFlowreport Theeventsreportsareavailableunderthe‘Behavior’menuinGoogleAnalytics: EventsOverviewreportinGoogleAnalytics The‘EventsOverview’reportprovidesanoverviewoftrackedeventsonyourwebsite: Totalevents–thetotalnumberofusers’interactionswithtrackedwebpageelements.Forexample,ifavisitorclicksonthe‘play’buttonofthesamevideo5times,thenGAreportstotaleventsas5 Uniqueevents–thetotalnumberofuniqueusers’interactionswithtrackedwebpageelementsinawebsession. Forexample,ifauserclicksonthe‘play’buttonofthesamevideofivetimes,thenGAreportstotaleventsasfivebutuniqueevents(numberofuniqueinteractionsthatoccurredinawebsession)asone. EventValue– thetotalvalueofaneventorsetofevents. Avg.Value –theaveragevalueofaneventorsetofevents. Sessionswithanevent–ThesearethoseGoogleAnalyticssessionswhereatleastonetrackedeventoccurred. Events/Sessionwithanevent–theaveragenumberoftrackedeventsthatoccurredinaGoogleAnalyticssession. TopEventsreportinGoogleAnalytics Throughthe‘TopEvents’report,youcandeterminethemostpopulareventcategories,eventactionsandevenlabels: Thepopularityismeasuredintermsoftotalevents. EventPagesreportinGoogleAnalytics Throughthe‘EventPages’report,youcandeterminethepagesofyourwebsiteonwhichthemaximumnumberofeventswererecordedbyGA: Thesearethepagesthatprovidemaximumuserengagement. EventsFlowreportinGoogleAnalytics Throughthe‘EventsFlow’report,youcanvisualizetheorderinwhichvisitorstriggeredeventsonyourwebsite.Thisreportalsoletsyouunderstandtheeventskeepingusersengagedonthewebsite. Inordertointerprettheeventsflowreportaccurately,itiscriticalthatyouuseclearandconsistentnamingconventionsforeventcategories,actions,andlabels. ConfiguringtheEventsFlowreportincludes: ExaminingNodesandConnectionsApplyingDefaultorcustomSegmentsComparingdatafromdifferenttimerangesSelectingdimensionsExportingtheeventsfunnelreportetc. Youcanlearnmoreaboutthisconfigurationhere. Eventdimensionsandmetrics Youalsoneedtorememberthat‘eventcategory’,‘eventaction’and‘eventlabel’arereportedasdimensionsinGAreports.Whereas‘eventvalue’isreportedasametricinGAreports: Note:‘eventcategory’,‘eventaction’and‘eventlabel’are‘hit’leveldimensions. Inotherwords,youcan’tuse‘eventcategory’,‘eventaction’and‘eventlabel’asmetricsinGAreports. Tounderstandthedifferencebetweendimensionsandmetrics,readthearticle: CompleteGuidetoDimensionsandMetricsinGoogleAnalytics HowtosetupeventsasgoalconversionsinGoogleAnalytics? YoucanalsoseteventsasGoalsinGoogleAnalyticsandassignmonetaryvaluestothem. Followthestepsbelow: Step-1:LogintoyourGoogleAnalyticsaccountandnavigatetothemainreportingview. Step-2:Navigatetotheadminsectionandthenclickon‘Goals’underthe‘View’column: Step-3:Clickon‘+NewGoal’button: Step-4:Scrolldownandthenselectthe‘custom’option(under‘GoalSetup): Step-5:Clickonthe‘continue’buttonandthengiveyourgoalaname(like‘AddtoCart’): Step-6:Selectgoaltypeto‘Event’andthenclickonthe‘Continue’button: Step-7:Enterthevaluesfor‘eventcategory’,‘eventaction’,‘eventlabel’(optional)and‘eventvalue’(optional): Step-8:Clickonthe‘Save’button. Eventtrackingconfigurationandcollectionlimits Apartfromthegeneralcollectionlimitsandquotas,therearelimitspersession. ThefirstteneventhitssenttoGoogleAnalyticsareprocessedandimmediatelytracked.Afterthis,trackingislimitedtoonehitpersecond. SettingupGoogleAnalyticseventtracking (gtag.js) FollowingisanexampleofaneventhitinGoogleAnalytics(gtag.js): gtag(‘event’,,{‘event_category’:,‘event_label’:



請為這篇文章評分?