[GA4] Set up events - Analytics Help
文章推薦指數: 80 %
This article describes how to set up an event on your website or app so you can add information that's useful to your business in Google Analytics.
Skiptomaincontent[GA4]SetupeventsCollectadditionalinformationfromyourwebsiteorappthrougheventsGoogleAnalyticscollectssomeinformationbydefaultwhenyousetuptheglobalsitetagortheTagManagersnippetonyourwebsiteortheGoogleAnalyticsforFirebaseSDKinyourapp.Foranyadditionalinformationyouwanttocollect,setuprecommendedorcustomevents.
Thisarticledescribeshowtosetupaneventonyourwebsiteorappsoyoucanaddinformationthat'susefultoyourbusinessinGoogleAnalytics.Ifyouwanttomodifyanexistingevent,seeModifyandcreateeventsviatheuserinterface.
Setupanevent
Whilesettingupcustomevents,notethateventnamesarecase-sensitive;twoeventswhosenamesdifferonlyincasewillresultintwodistinctevents.
Usethefollowingdrop-downstoseeinformationabouthowtosetupanevent:
Globalsitetag(Websites)
Howeventsarestructured
Onceyouaddtheglobalsitetagtoyourwebsite,Googlewillprocessanyeventsyouincludeinyourwebsitecode.Allglobalsitetageventshavethefollowingstructure,whichyoucanlearnmoreaboutintheGlobalsitetagAPIreference:
gtag('event','screen_view',{
Modifywheneventsaresent
BecauseeventsareallwritteninJavaScript,youcanapplyadditionalJavaScripttoyoureventstochangewhenandhowthey'resent.Forexample,ifyouwanttosendaneventwhensomeoneclicksanAddtocartbutton,youcoulddothefollowing:
Step1:AddthebuttonwithanID
Forexample,youcouldaddanaddToCartIDsoyoucansendtheeventwhenthebuttonisclicked.
延伸文章資訊
- 1Google Analytics Event Tracking Tutorial - Optimize Smart
So following event tracking codes are going to create tracking issues: ga('send','event',videos,'...
- 2Log events | Firebase Documentation
If you're already familiar with Google Analytics, this method is ... If your application has spec...
- 3Event tracking not working with Monster Insights Google ...
What is the difference between the __gaTracker and ga Analytics trackers? Basically, the differen...
- 4[GA4] Set up events - Analytics Help
This article describes how to set up an event on your website or app so you can add information t...
- 5Send data to Google Analytics with gtag.js
This page describes how to use gtag.js commands to send data from your site to Google Analytics. ...