How to set up Facebook event deduplication in Google Tag ...
文章推薦指數: 80 %
For this method, you must use event ID for all events you send via pixel and CAPI. FB will deduplicate Facebook Pixels and Conversion API ... BlogFacebookHowtosetupFacebookeventdeduplicationinGoogleTagManagerAuthorStapePublishedMarch12,2021commentsJointheconversationAlsoavailableinESRUDEFRPTUsingFacebookserver-sidetracking(FacebookConversionsAPI)isgettingmorepopularduetoitsabilitytopreventtrackingpixelblockingbyITPsandAdBlockers.AnothermassivebenefitofFacebookconversionAPIisthatitincreasesFBcookielifetime.Ifyouhaven’tyetimplementedFBConversionsAPIonyoursite, followthisguide. Inthisarticle,IwilldescribehowtosetupFacebookeventsdeduplicationifyouareusingbothbrowserandservertrackingmethodsforyoursite.WhydoyouneedtosetupFacebookeventdeduplication?CopylinktothissectionTheFacebookpixelandConversionsAPIletsyousharestandardandcustomeventswithFBsothatyoucanmeasureandoptimizeadperformance.Thepixelenablesyoutosharewebeventsfromawebbrowser,whiletheConversionsAPIletsyousharewebeventsdirectlyfromthecloudserver. BothFacebookpixelandFacebookconversionAPIletyousendevents.Thedifferenceisthatpixelsendseventsfromthebrowser,andCAPIsendseventsfromtheserver.IfyoutellFacebookthatthebrowserandservermethodsendidenticalevents,theywillacceptoneanddiscardanother.ThereareseveralwaysofsettingupFacebooktracking,includingthefollowing:Usingsolelybrowser(pixel)method.ItisnotrecommendedbyFBbecauseofusertrackingrestrictions.Usingonlyservertracking.ThemainbenefitofhavingtrackingonlyontheserveristhatFBpixelwillnotoverloadyourwebsite.Yoursitewillloadfaster,anditwillleadtoabetteruserexperience.Combinebrowserandservertracking.Hereyouhaveseveraloptions:Sendsomeeventsfromthebrowserandanotherfromserver.Forexample,ShopifynativeFBConversionAPIintegrationwillsendallFBeventsthroughthebrowserandpurchaseeventsfromtheServer.Inthiscase,youdonotneedthededuplication.Sendalleventsfromthebrowserandserver.Ifyoudecidetousebothbrowserandservereventstrackingforallyourevents,inthiscase,youwillneedtosetupeventdeduplication.WithFacebookeventdeduplication,FBwillreceiveallyourevents,understandthateventsareidentical,cleansomeofthem,andkeepothers.Ifyoucombinethebrowserandservermethodbutdonotsetupeventdeduplication,yourdatawillnotbecorrectbecausealltheeventswillbetrackedtwice.Facebookrequiressendingtwoeventparametersforeventdeduplication:itseventnameandeventID.Youalreadysendingtheeventnamewiththeexistingsetup.ThisarticlewillcoverhowtoconfigureFacebookeventIDinsidetheGoogleTagManagercontainer.HowdoesFacebookeventdeduplicationwork?CopylinktothissectionFacebookhastwowayofidentifyingduplicatedeventsthatweresentfrombrowserandserver:1.EventIDandeventname. Facebookrecommendsthismethod,andwewillcoveritinourhow-to.Forthismethod,youmustuseeventIDforalleventsyousendviapixelandCAPI.FBwilldeduplicateFacebookPixelsandConversionAPIeventswithidenticaleventnamesandeventIDs.Facebookgivesmorecredittothebrowserevent,andiftheyseesimilareventsandcomewithin5minutesdifference,theywillkeepbrowsereventsandcleanserverevents. 2.FBPorExternalIDThismethodexistsbutisnotrecommendedbyFacebook.Inthiscase,youwillneedtosendtheeventname,fbp,and/orexternal_idforallyourbrowserandserverevents.Facebookcomparesalltheseparametersandidentifiesiftheyalreadyhaveabrowsereventwiththeseparameters,andiftheydo,theydiscardserverevents.FBdoesnotrecommendusingtheseeventssincetheycanidentifydeduplicationonlyifthebrowsereventwassentfirst.Itmeansthatifyousendaservereventfirst,eventswillbeduplicated. Facebookalsocanmergeevents.Forexample,ifyousendsomeenricheddatafromtheserver,youcanaddthemissingdatatothebrowserevent.Thatisnotadefaultfeature.Toenableit,youshouldcontactaFacebookrepresentative.HowtosetupFacebookeventdeduplicationviaGoogleTagManager?CopylinktothissectionWecreateda customGoogleTagManagervariable thatgeneratesuniqueeventIDyoucanuseitin yourwebandserverFacebookevents.Itwillallowyoutotrackusersbothfrombrowserandserveranddeduplicateevents.ThismethodwillworkifyourFacebookpixelissetupinsidetheGoogleTagManagerWebContainerandifFacebookconversionAPIissetupviaGoogleTagManagerServerContainer.1.YouneedtohaveFacebookconversionAPIsetupviaGoogleTagManagerservercontainer.Please followthishow-to ifit’snotyetsetuponyoursite. 2.Clickon thislink todownloadacustomvariablethatsendsauniqueeventIDoradditusing TemplateGallery.3.IfyoudownloadedvariabletemplatefromGitHub->GotoyourGoogleTagManager Web Containerandimportthevariablethatyou’vejustdownloaded.ClickTemplates->New(insidetheVariableTemplates)->clickonthethreedotsonthetoprightcorner->import->selectvariable->Whendone,clickSave.GototheVariablestabinsidetheWebcontainer->UnderUser-DefinedVariablesclickNew->createaUniqueeventIDvariableusingthetemplateyou’veimported. 4.AddthisvariabletoallFacebooktagsyouhaveinsidetheWebContainer. IfyouareusingFBtagtemplate:OpenFacebookTag->ClickMoreSettings->AddvariabletothefieldsEventID->ClickSave. Ifyou’veaddedFBtagsviacustomHTML:OpenFacebookTag->addeventIDparametertotheFacebookevent->ClickSave. eventID:‘{{EventID}}’!FollowthenextstepsifyouuseUniversalAnalytics.IfyouuseGA4,pleasescrolldowntostep95. WewillconfigureasetupthatwillpassthesameeventIDtotheGoogleTagManager Server containerinthisstep.SinceourFacebookservertagworksbasedontheGoogleAnalyticsevents,wewilladdFacebookeventsIDtoGoogleAnalyticstagsinsidethe Web container.Inthisexample,IwillsendanEventIDinsidetheGoogleAnalyticsCustomDimension.Youcansenditviaotherfields. OpenUniversalAnalyticstaginsidethe Web container->ClickMoresettings->CustomDimension->AddindexandselectEventIDvariable.AddFacebookeventIDtoallGAcustomdimensions(orotherparametersyou’veselected)thatyouwanttotrackinsidetheservercontainer. Onceyou’vedoneit,gotothepreviewmodeandverifythateverythingworkscorrectly.Then,Publishtheupdates.6.GotoyourGoogleTagManager Server Container->ClickVariables->NewVariable->selectvariabletypeQueryParameter->Parameternamecd1(inmycasebecausetheindexofthecustomdimensionthatI’vecreatedinthewebcontaineris1)->ClickSave.7. GotothePreviewmodeandcheckthattheGoogleTagManagerServercontainerseesthevariableyou’vecreated. 8.OpenFacebookTaginsidetheGoogleTagManagerServerContainer->ClickServerEventDataOverride->inthePropertyNameselectEventID->inthePropertyValueselectvariablethatyou’vecreatedintheserverContainer.AddEventIDVariabletoallFacebooktagsinsidetheservercontainer.Oncethetaggoestotheserverpreviewmode,thattestchanges. !ThenextstepsareforsetupeventidthruGA4.IfyouuseUniversalAnalytics,pleaseproceedtostep139. CreateoruseyourexistingGA4eventtaginsidetheWebcontainer->EventParameters->Addevent_idasParameternameandselectEventIDvariableasavalue.Also,checkwhattriggeryouusefortheGA4event.YoualwaysshouldusethesametriggerforFacebooktagandGA4for identicalevents.Forexample,GA4andFBaddtocarttagsshouldusethesametrigger,inthiscasetheventIDwillbeidentical. AddFacebookeventIDtoallGA4eventtagsthatyouwanttotrackinsidetheservercontainer.ToreducechancesofthesameeventIDsentformultipleproperties,youcanaddeventnamebeforetheeventIDvariable.(similartothescreenshotbellow).👇Onceyou’vedoneit,gotothepreviewmodeandverifythateverythingworkscorrectly.Then,Publishtheupdates.10.GotoyourGoogleTagManager Server Container->ClickVariables->NewVariable->selectvariabletypeEventData->Keypathevent_id(inmycasebecausetheparameternamethatI’vecreatedinthewebcontainerisevent_id)->ClickSave.11.OpenFacebookTaginsidetheGoogleTagManagerServerContainer->ClickServerEventDataOverride->inthePropertyNameselectEventID->inthePropertyValueselectvariablethatyou’vecreatedintheserverContainer.AddEventIDVariabletoallFacebooktagsinsidetheservercontainer.12. Gotothepreviewmodeandcheckthattheevent_idvariableyoucreatedonthewebcontaineristhesameaswhatyousendtoFacebook.13. Inthisstep,wewillverifythatFacebookeventdeduplicationworked.GototheTestEventtoolinsideyourFacebookBusinessManager->Makesurethatyou’veaddedtestIDtotheFacebooktaginsidetheGoogleTagManager Server container->CheckthatFacebookshowsserverandbrowsereventsinthetestingtoolandoneoftheeventswasdeduplicated. MakesureyouremovetestIDfromFacebookconversionAPItagsaftertestingorsetupaTestIDasalook-uptablevariablethatworkswhendebugmodeistrue.Otherwise,youmightseeadeduplicationerrorintheFBeventsmanager.14.Don’tforgettopublishyourchanges. Conclusion:CopylinktothissectionFacebookconversionAPIisanexcellentsolutionifyouwanttotrackyoursiteusersmoreaccurately,bypassadblockersandITPs,andextendcookielifetime. Withacombinedserverandbrowsermethod,youwillstillrunFacebookpixelsinthebrowser,makingyoursiteheavier.Usingthismethod,youcanbe100%surethatyoudidnotmissanyusersoreventsonyoursite. IfyouhavesomequestionsorcommentsaboutimplementingFacebookeventdeduplication,pleaseletmeknowinthecomments.Taggedwith:FacebookRelevantpostsSeptember07,2021FacebookconversionAPIerrorsandhowtofixitSettinguptheFacebookconversionAPImaybeconfusing.ButafteryoudidthetremendousjobofmovingFBtrackingtotheserverandthinkthatjobisdone,youmightlogintoyoureventsmanagerthenextdayandseeredandyellowwarnings.Inthisblogpost,IwilldescribethemostpopularFacebookconversionAPIerrorsandwarnings.Plus,sharesometipsonhowtofixit.August16,2021FacebookEventMatchQuality–WhatitisandhowtoincreaseitUsingFacebookconversionAPI,youcansendeventsfromyourservertotheFacebookserver.Server-sidetrackingwithconfiguredcustomsubdomainhelpstobypassadblockers,ITPs,andiOS14restrictions.HostyourGTMserveratStapeTryforfreeBysigningupyouagreetoStape’sTermsofUseandPrivacyNotice
延伸文章資訊
- 1About Deduplication for Facebook Pixel and Conversions API ...
We deduplicate pixel events with identical event and eventID parameters. Redundant server events....
- 2Facebook Conversions API (CAPI) - Facebook Pixel FAQ
These changes will affect how Facebook receives and processes conversion events from tools such a...
- 3How do I send event_id with Facebook pixel? - Stack Overflow
To add an event_id parameter to the events you're sending through your pixel, go into your websit...
- 4Facebook conversion API errors and how to fix it - Stape.io's
For example, for the PageView events, send the same event ID and event name from Facebook pixel a...
- 5Handling Duplicate Events - Conversions API - Facebook for ...
We determine if events are identical based on their ID and name. So, for an event to be deduplica...