How to Set Up Google Analytics Event Tracking - Hootsuite Blog

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

What is Google Analytics event tracking used for? · # of clicks on a button · # of clicks to outbound links · # of times users downloaded a file · # ... Skiptocontent Ifyouwanttotrackandrecorddatathataren’tnormallyrecordedinGoogleAnalytics,youneedtolearnhowtosetupGoogleAnalyticseventtracking. Soyou’vesetupyourwebsite. You’veplannedoutyourcontentcalendar. Andyou’veevencreatedaGoogleAnalyticsaccounttostarttrackingvitalmetricsforyourbusiness. Awesome!Butyou’reprobablyaskingyourself,“Whatnow?” Afteryou’velaidthefoundationforyourbusiness’swebsite,it’stheperfecttimetosetupGoogleAnalyticseventtracking. Thisallowsyoutotrackandrecorddatathataren’tnormallyrecordedinGoogleAnalytics—givingyouaccesstoawealthofdatayouwouldn’tbeabletootherwisemeasure. Andtherearetwowaysyoucangoaboutsettingitup: Manually.Thistakesalittlebitofextracodingknow-how. GoogleTagManager(recommended).Thisrequireslittletonocodingknowledge. Let’swalkthroughbothmethodsofsettingupGoogleAnalyticseventtracking,andlookathowexactlythetoolworks. Butfirst… Bonus:Getafreesocialmediaanalyticsreporttemplate thatshowsyouthemostimportantmetricstotrackforeachnetwork. WhatisGoogleAnalyticseventtrackingusedfor? TounderstandGoogleAnalyticseventtracking,youfirsthavetounderstandwhatan“Event”is. “Eventsareuserinteractionswithcontentthatcanbetrackedindependentlyfromawebpageorascreenload,”accordingtoGoogle.“Downloads,mobileadclicks,gadgets,Flashelements,AJAXembeddedelements,andvideoplaysareallexamplesofactionsyoumightwanttotrackasEvents.” Elementscanincludethingslikebuttons,videos,lightboxes,images,andpodcasts. SoGoogleAnalyticseventtrackingisjustthewayGAmeasuresandrecordsavarietyofdifferentmetricsrelatedtovisitorengagementwiththeseelements. Forexample,ifyouwanttoseehowmanypeopledownloadaPDFyouhaveonyourwebsite,youcansetitupsothatGoogleAnalyticsrecordsthateventeverytimeithappens. Someotherthingsyoucanrecordusingeventtracking: #ofclicksonabutton #ofclickstooutboundlinks #oftimesusersdownloadedafile #oftimesuserssharedablogpost Howmuchtimeusersspendwatchingavideo Howusersmovedtheirmouseonapage Formfieldabandonment WhenyoucoupleitwithyourGoogleAnalyticsgoals,eventtrackingcanhelpprovetheROIofamarketingcampaign. NowthatweknowexactlywhatGoogleAnalyticseventtrackingisusedfor,let’stakealookathowittrackstheevents. Howdoeseventtrackingwork? Eventtrackingleveragesacustomcodesnippetthatyouaddtotheelementsthatyouwanttotrackonyourwebsite.Wheneverusersinteractwiththatelement,thecodetellsGoogleAnalyticstorecordtheevent. Andtherearefourdifferentcomponentsthatgointoyoureventtrackingcode: Category.Thenamethatyougivetheelementsyouwanttotrack(e.g.videos,buttons,PDFs). Action.Thetypeofinteractionyouwanttorecord(e.g.downloads,videoplays,buttonclicks). Label(optional).Supplementaryinformationabouttheeventthatyou’retracking(e.g.nameofthevideousersplay,titleoftheebookusersdownload). Value(optional).Anumericalvalueyoucanassigntoatrackingelement. AlloftheaboveinformationissenttoyourGoogleAnalyticsaccountviatheeventtrackingcode. Thatmeanswhenit’sembeddedontoawebpage,it’llsendinformationandmetricsregardingtheeventyouwanttorecordbacktoyourGAaccountintheformofaneventreport. Nowthatyouhaveagoodideaaboutwhateventtrackingis—andhowitworks—let’sjumpintothetwowaysyoucansetitup. Howtosetupeventtrackingmanually Betweenthetwomethods,thisoneisthetrickiest—butbynomeansimpossible. Youdon’tneedamastersdegreeincomputerengineeringtodosomebasicbackendcodingonyourwebsite.Ifyoufollowthestepsbelow,you’llbeabletodothat(mostly)pain-free. Step1:LinkyoursitetoGoogleAnalytics SetupGoogleAnalyticsifyouhaven’talready.Ifyouneedhelpwiththat,besuretocheckoutourarticleonhowtosetupGoogleAnalytics. Onceyou’vedonethat,you’regoingtohavetofindyourGoogleAnalyticstrackingID.ThiswillbeasnippetofcodethatlinksyourGAaccountwithyourwebsite. YoucanfindthetrackingIDintheadminsectionofyouraccount. Source:Google ThetrackingIDisastringofnumbersthattellsGoogleAnalyticstosendanalyticsdatatoyou.It’sanumberthatlookslikeUA-000000-1.Thefirstsetofnumbers(000000)isyourpersonalaccountnumberandthesecondset(1)isthepropertynumberassociatedwithyouraccount. Thisisuniquetoyourwebsiteandyourpersonaldata—sodon’tsharethetrackingIDwithanyonepublicly. OnceyouhaveyourtrackingID,you’llnowhavetoaddthesnippetafterthe

tagofeachpageonyourwebsite. Ifyou’reusingWordPress,youcanmakethisprocesseveneasierbyinstallingandactivatingtheInsertHeadersandFootersplugin.ThiswillallowyoutoaddanyscripttotheHeaderandFooterthroughoutyourentirewebsite. Source:WPBeginner Step2:Addeventtrackingcodetoyourwebsite Nowit’stimetocreateandaddeventtrackingcodes. Theeventtrackingcodeismadeupofthefourelementswementionedabove(i.e.category,action,label,andvalue).Together,youusethemtocreateatrackingcodesnippetthatlookslikethis: onclick=ga(‘send’,‘event’,[eventCategory],[eventAction],[eventLabel],[eventValue]);” Simplyreplacethecategory,action,label,andvalueplaceholderswithyourowncustomizedelementsbasedontheeventsyouwanttotrack.Thenplacetheentirecodesnippetafterthehreftagonyourpagethatyouwanttotrack. Sointheend,it’lllooksomethinglikethis: LINKNAME Let’srunthroughanexample: SayyourcompanywantstotrackthenumberofdownloadsyougetonaleadmagnetPDF.Youreventtrackingcodemightlooklikethis: LEADMAGNETDOWNLOADPAGE NoweverytimesomeonedownloadsthePDF,it’llberecordedandsenttoyourGoogleAnalyticseventsreportspage—whichbringsusto: Step3:Findyoureventreport Gotothemaindashboardforyourwebsite’sGoogleAnalytics.Clickon“Events”under“Behavior”inthelefthandsidebar. Thereyou’llfindfoureventreportsyoucanview: Overview.Thisreportgivesyouabroadhighlevellookattheeventsonyourwebsite.You’llbeabletoseetheuniqueandtotalnumberoftimesusersinteractedwiththeelementsyouaretrackingaswellasthetotalvalueofthoseevents. Topevents.Thisreportshowsyouhowpopularcertaineventsare,withthetopeventcategories,actions,andlabelsshown. Pages.Thisreportgivesyouabreakdownofwhichpageshaveeventsinwhichyouaretracking. Eventsflow.Thisreportgivesyouavisualizationofyouruser’sexperience.You’llbeabletoseethe“orderinwhichuserstriggertheEventsonyoursite.” Checkoutthevideobelowformore. Withtheseeventreports,you’llbeabletoprovetheROIoftheelementsyouaretracking.You’llalsobeabletodeterminewhat’sworking,what’snotworking,andwhatneedssomefinetuningtogiveyourusersthebestexperiencepossible. Bonus:Getafreesocialmediaanalyticsreporttemplate thatshowsyouthemostimportantmetricstotrackforeachnetwork. Getthefreetemplatenow! HowtosetupeventtrackingwithGoogleTagManager NowthatyouknowhowtomanuallysetupGoogleAnalyticseventtracking,let’stakeatasimplermethod:GoogleTagManager(GTM). GTMisatagmanagementsystemofferedforfreefromGoogle. TheplatformtakesthedataonyourwebsiteandsendsittootherplatformssuchasFacebookAnalyticsandGoogleAnalyticswithlittletonobackendcodingonyourpart. You’llbeabletoupdateandaddtagstoyourGoogleAnalyticscodewithouthavingtomanuallywritecodeonthebackend.Thiswillsaveyouatonoftimedowntheroad. Forexample,ifyou’retryingtotrackthenumberofdownloadsofaPDF.Usingtheabovemethod,youwouldhavetochangeallthedownloadlinkseverywhereonyourwebsitetodothis. However,ifyouhaveGTM,you’dbeabletoaddanewtagtotrackthenumberofdownloads. Let’sjumpinandseehowexactlyyoucangoaboutsettingupGTMtomakeyoureventtrackingeasierandsimpler. Step1:SetupGoogleTagManager CreateanaccountontheGoogleTagManagerdashboard. Putinanaccountnamereflectiveofyourbusiness.Thenchooseyourcountry,choosewhetherornotyouwanttosharedatawithGoogle,andclickcontinue. You’llthenbetakentothispage: Thisiswhereyouwillsetupacontainer. Acontainerisabucketthatcontainsallofthe“macros,rules,andtags”foryourwebsite. Giveyourcontaineradescriptivenameandselectthetypeofcontentit’llbeassociatedwith(Web,iOS,Android,orAMP). Thenclickcreate,reviewtheTermsofService,andagreetothoseterms.You’llthenbegiventhecontainer’sinstallationcodesnippet. Thisistheonlypieceofcodeyou’llbepastingintoyourwebsite’sbackendinordertomanageyourtags. Todothat,copyandpastethetwosnippetsofcodeontoeverypageofyourwebsite.Astheinstructionssay,you’llneedtothefirstoneintheheaderandthesecondaftertheopeningofthebody. AswithGoogleAnalytics,youcanmakethisprocesseveneasierbyinstallingandactivatingtheInsertHeadersandFootersplugin.ThiswillallowyoutoaddanyscripttotheHeaderandFooterthroughoutyourentirewebsite. Step2:Turnonbuilt-invariables Now,you’llneedtomakesurethatGTM’sbuilt-invariablesareenabledinordertocreateyourtags. FromyourmainGTMdashboard,clickon“Variables”onthesidebarandthenclickon“Configure”onthenextpage. Fromhere,you’llbeabletochooseallthevariablesyouwanttotrack.Makesureyouhavethosevariablesmarkedwithacheckmarkintheboxes. Onceyouhaveallyourvariableschosen,you’llbeabletocreateatag. Step3:Createatag GotoyourGoogleTagManagerdashboardandclickonthe“Addanewtag”button. Youwillbetakentoapagewhereyoucancreateyournewwebsitetag. Onit,you’llseethatyoucancustomizetwoareasofyourtag: Configuration.Wherethedatacollectedbythetagwillgo. Triggering.Whattypeofdatayouwanttocollect. Clickonthe“TagConfigurationbutton”tochoosethetypeoftagyouwanttocreate. You’llwanttochoosethe“UniversalAnalytics”optioninordertocreateatagforGoogleAnalytics. Onceyouclickonthat,you’llbeabletochoosethetypeofdatayouwanttotrack.Dothatandthengoto“GoogleAnalyticsSettings”andchoose“NewVariable…”fromthedropdownmenu. You’llthenbetakentoanewwindowwhereyou’llbeabletoenterinyourGoogleAnalyticstrackingID.Thiswillsendyourwebsite’sdatastraightintoGoogleAnalyticswhereyou’llbeabletoseeitlater. Oncethisisdone,headtothe“Triggering”sectioninordertoselectthatdatayouwanttosendtoGoogleAnalytics. Aswiththe“Configuration,”clickontheTriggeringbuttoninordertobesenttothe“Chooseatrigger”page.Fromhere,clickon“Allpages”soitsendsdatafromallyourwebpages. Whenallissaidanddone,yournewtagsetupshouldlooksomethinglikethis: Nowsimplyclickonsaveandvoila!YouhaveanewGoogleTagtrackingandsendingdatatoyourGoogleAnalyticspageaboutyourwebsite! Whatnext? Onceyou’vesetupyourGoogleAnalyticseventtracking,congrats!You’reonyourwaytogettingafuller,morecomprehensivepictureofyourwebsite,business,andtargetaudience. You’llbeabletoprovetheROIofacampaign,seewhatvideosorlinksyourusersliketoclickon,andimprovefeaturesonyourwebsitetobetterserveyouraudience. BesuretocheckoutafewofourarticlesbelowthatcanhelpyougetthemostoutofyourGoogleAnalyticsandROIexperience: A6-stepguidetotrackingsocialmediaviaGoogleAnalytics Howtoprove(andimprove)socialmediaROI HowtosetupGoogleAnalytics It’scrucialthatyouknowexactlywhatyourdataandmetricsarewhenitcomestosocialmedia. DrivemoretraffictoyourwebsitewiththehelpofHootsuite.Fromasingledashboardyoucanmanageallyoursocialmediaprofilesandmeasuresuccess.Tryitforfree. GetStarted ShowComments x Sorryforgettinginyourface,but... Wehaveaspecialtreatforyou.Schedulesocialposts,getreports,andhandleallyourcommentsandDMsinoneplace. TryHootsuiteforfreefor60days.(That’s30daysmorethanpeoplewhodon’treadpopupsget.) StartYourFree60-DayTrial Offerexpiresin04m 20s Norisk,allreward.Cancelanytimewithin60days ThankYou


請為這篇文章評分?