event tracking in google analytics using gtag.js - Stack Overflow

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

You should be using gtag.js to send GA events, since that's your method of implementation of GA, not ga() as that's for analytics.js. Home Public Questions Tags Users Companies Collectives ExploreCollectives Teams StackOverflowforTeams –Startcollaboratingandsharingorganizationalknowledge. CreateafreeTeam WhyTeams? Teams CreatefreeTeam Collectives™onStackOverflow Findcentralized,trustedcontentandcollaboratearoundthetechnologiesyouusemost. Learnmore Teams Q&Aforwork Connectandshareknowledgewithinasinglelocationthatisstructuredandeasytosearch. Learnmore eventtrackingingoogleanalyticsusinggtag.js AskQuestion Asked 3years,7monthsago Modified 3years,7monthsago Viewed 8ktimes 1 1 IhaverecentlystartedlearningGoogleAnalytics(GA).IhavesinglepageapplicationinAngular.Thereisaloginbuttonintheapplication.IwantedtotrackhowmanyusersareloggedinusingGA.SowhatididisicreatedapropertyinGAandgotthetrackingid.Theniaddedthefollowingscriptjustaftertheinindexpage. Nowiaddedthega()iftheloginissuccessful.Butunfortunatelywhenisuccessfullylogin,ican'tfindanydatainEventCategoryandEventActionlistedinREAL-TIME->Events->bottommosttable.Iamnotabletofigureoutwhy? $http({entercodehere method:'POST', 'async':true, 'cache':false, 'global':false, url://thecorrecturl, isStaySignIn:isStaySignIn, isIdamOn:true, }).success(function(data,status,headers){ $rootScope.Loading="Loading"; deferred.resolve({ data:data, headers:headers }); ga('send',{ hitType:'event', eventCategory:'MODE', eventAction:'IDAM', eventLabel:'LoginusingJioID' }); }) google-analytics Share Improvethisquestion Follow editedOct25,2018at18:59 XTOTHEL 4,83711goldbadge88silverbadges1616bronzebadges askedOct25,2018at16:07 NEHANEHA 6922silverbadges55bronzebadges 1 You'reusinggtag.jsasthemethodofimplementationforGA,youshouldn'tbeusingga()methodsasthat'sreallyfortheanalytics.jsmethod. – XTOTHEL Oct25,2018at17:07 Addacomment  |  1Answer 1 Sortedby: Resettodefault Highestscore(default) Datemodified(newestfirst) Datecreated(oldestfirst) 4 Youshouldbeusinggtag.jstosendGAevents,sincethat'syourmethodofimplementationofGA,notga()asthat'sforanalytics.js. Thepatterntosendaneventis: gtag('event',,{ 'event_category':, 'event_label':



請為這篇文章評分?