Handling Duplicate Events - Conversions API - Facebook for ...

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

We determine if events are identical based on their ID and name. So, for an event to be deduplicated: In corresponding events, a Facebook Pixel's eventID must ... ConversionsAPIGetStartedUsingtheAPIVerifyingSetupGuidesParametersHandlingDuplicateEventsPayloadHelperBestPracticesTroubleshootingHandlingDuplicatePixelandConversionsAPIEvents Foroptimaladperformance,werecommendthatadvertisersimplementtheConversionsAPIalongsidetheirFacebookPixel.Wecallthisa"redundantsetup"anddetailmoreaboutthisrecommendedapproachhere. Whenadvertisersusearedundantsetup,theymustsetupadeduplicationmethodtoensurethattheaddeliverysystemisabletodifferentiatebetweendistinctandoverlappingevents.ThisdocumentdescribesmultiplededuplicationmethodoptionstohelpFacebookdeduplicateyourevents. AdvertiserswhodonotsendthesameeventtwiceviaboththeConversionsAPIandFacebookPixeldonotneedtosetupdeduplicationforthoseevents. EventDeduplicationOptions FacebooktriestodeduplicateidenticaleventssentthroughFacebookPixelandtheConversionsAPI.Wehavetwowaysofdeduplicatingyourevents: EventIDandEventName(Recommended) RequiredParameters Forthisapproach,theevent_idparameterisaddedtoyoureventsfromboththeConversionsAPIandthebrowserpixel.Theevent_idparameterisanidentifierthatcanuniquelydistinguishbetweensimilarevents.Readmoreabouttheevent_idparameter. ApproachDescription WedetermineifeventsareidenticalbasedontheirIDandname.So,foraneventtobededuplicated: Incorrespondingevents,aFacebookPixel'seventIDmustmatchtheConversionAPI'sevent_id. Incorrespondingevents,aFacebookPixel'seventmustmatchtheConversionAPI'sevent_name. Onceyoureventfulfillsbothconditions,wekeepthefirstoneandremovethefollowingone.Ifaserverandbrowsereventarriveatapproximatelythesametime(within15secondsofeachother),wefavorthebrowserevent. NotethattheeventIDparameterforthepixelisthe4thargumentinthefbqtrackcall. Example fbq('track','Purchase',{value:12,currency:'USD'},{eventID:'EVENT_ID'}); FBPorExternalID RequiredParameters Forthisapproach,youmustuseevent_name,fbpand/orexternal_idconsistentlyacrossbrowserandserverevents. ApproachDescription Ifyouhaveconfiguredtheexternal_idand/orfbpparameterstobepassedviabothbrowserandserver,wetakecaretoremoveduplicateeventsautomatically.Thisishowtheprocessworks: Yousendusabrowsereventwithevent_nameandfbpand/orexternal_id. Then,yousendusaservereventwithevent_nameandfbpand/orexternal_id. Wecomparetheservereventwiththepreviouslysentbrowserevent.Specifically,wecomparetheevent_nameandfbpand/orexternal_idcombinations. Ifweseethatwealreadygottenthateventfromthebrowser,wediscardtheserverevent. ApproachLimitations Thisdeduplicationmethod: Alwaysdiscardstheserverevent. Onlyworksfordeduplicatingeventssentfirstfromthebrowserandthenthroughtheserver.Servereventswillnotbediscardedifabrowsereventhasnotbeenreceivedinthepast48hours,evenifanidenticalbrowsereventarrivesaftertheserverevent. Doesnotdeduplicateeventswhenonlyusingoneeventsource,thatisbrowser-onlyorserver-only.Ifyousendustwoconsecutivebrowsereventswiththesameinformation,wedonotdiscardeither.Ifyousendustwoconsecutiveservereventswiththesameinformation,wedonotdiscardeither. SettingUpDeduplicationontheBrowserPixel Forbettermatching,weneedaccurateinformationfromyoureventscomingthroughbothFacebookPixelandtheConversionsAPI: TheeventIDinsidetheoptionaleventDataparametershouldbeauniquevalue.DependingonyourFacebookPixelimplementation,youcanuse: tracktosendtheeventforallpixelsonthepage fbq('track','Purchase',{value:12,currency:'USD'},{eventID:'EVENT_ID'});trackSingletosendtheeventforonepixel fbq('trackSingle','SPECIFIC_PIXEL_ID','Purchase',{value:12,currency:'USD'},{eventID:'EVENT_ID'});Animagepixeltagwiththeeidparameter Iftheeventyouaresharingdoesnotcontainparameterssuchasvalueandcurrency,youcansetitupasfollows: fbq('track','Lead',{},{eventID:'EVENT_ID'});TheeventIDfromtheFacebookPixelmustmatchtheevent_idinthecorrespondingeventcomingfromtheConversionsAPI.Ifwefindthesameserverkeycombination(event_idandevent_name)andbrowserkeycombination(eventIDandevent)senttothesamepixelIDwithin48hours,wediscardthesubsequentevents.IfyouaresendingusyoureventsviabothbrowserandtheConversionsAPIalongwithmatchingevent_ids,keepinmindthateventsareonlydeduplicatediftheyarereceivedwithin48hoursofwhenwereceivethefirsteventwithagivenevent_id.VerifyingYourDeduplicationSetup LearnhowtoverifyyourdeduplicationandeventmergingsetupintheVerifyingYourSetupdocumentation.



請為這篇文章評分?