Facebook Pixel Destination | Segment Documentation

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

Conversion events only support currency and value as event properties, so only these will be associated with the event. currency will default to ... Login SignUp Home / Connections / Destinations / Catalog / FacebookPixelDestination FacebookPixelDestination Onthispage OtherFacebookDestinationsSupportedbySegment GettingStarted Page Identify Track LimitedDataUse Settings Troubleshooting Settings Relatedcategories Advertising DestinationInfo AcceptsPage,Identify,andTrackcalls. ReferredtoasFacebookPixelintheIntegrationsobject Components Browser ConnectionModes Device-mode Cloud-mode Web Web Mobile Mobile Server Server FacebookPixelletsyoumeasureandoptimizetheperformanceofyourFacebookAds.Itmakesconversiontracking,optimizationandremarketingeasierthanever.TheFacebookPixelDestinationisopen-source.YoucanbrowsethecodeonGitHub. Facebookhasdeprecatedthemodular“AdsForWebsites”suite,whichpreviouslycomprisedFacebookCustomAudiencesandFacebookConversionTracking.We’veconsolidatedthosetwodestinationsintothisnewandimproved“FacebookPixel”destination. UseCases IncreaseconversionsbyretargetingshoppingcartabandonersonFacebook OtherFacebookDestinationsSupportedbySegment ThispageisabouttheFacebookPixel.FordocumentationonotherFacebookdestinations,seethepageslinkedbelow. FacebookDestination SupportedbyPersonas FacebookAppEvents Yes FacebookOfflineConversions Yes FacebookPixel No FacebookCustomAudiences Yes FacebookCustomAudiencesWebsite Yes GettingStarted Beforeyoustart,makesureFacebookPixelsupportsthesourcetypeandconnectionmodeyou’vechosentoimplement.Youcanlearnmoreaboutconnectionmodeshere. Web Mobile Server 📱Device-mode ✅ ⬜️ ⬜️ ☁️Cloud-mode ⬜️ ⬜️ ⬜️ FromtheSegmentwebapp,clickCatalog. Searchfor“FacebookPixel”intheCatalog,selectit,andchoosewhichofyoursourcestoconnectthedestinationto. Inthedestinationsettings,enteryourpixelIdfromthePixelstabinFacebookAdsManager. SegmentautomaticallyinitializesFacebook’spixelwithyourpixelIduponloadinganalytics.js. Page Ifyou’renotfamiliarwiththeSegmentSpecs,takealooktounderstandwhatthePagemethoddoes.Anexamplecallwouldlooklike: analytics.page(); We’vemappedanalytics.page()toFacebook’sfbq('track',"PageView")methodandwillforwardallpageviewsaccordingly.Notethattheintegrationwillignoreanyparametersyoupasstoanalytics.page(). Identify Ifyou’renotfamiliarwiththeSegmentSpecs,takealooktounderstandwhattheIdentifymethoddoes.Anexamplecallwouldlooklike: analytics.identify('ze8rt1u89',{ name:'ZaphodKim', gender:'Male', email:'[email protected]', phone:'1-401-555-4421', address:{ city:'SanFrancisco', state:'Ca', postalCode:'94107' } }); WhenyoumakeanIdentifycallwithSegment,itwillupdateFacebookPixelthenexttimetheuserloadsapageonyourwebsite.FacebookPixeldoesnotsupportimmediatelyupdatinguserpropertiesusingIdentify.WhenyouperformanIdentifycallinSegment,itwillupdateinFacebookPixelusingtheirAdvancedMatchingfeature. Track Ifyou’renotfamiliarwiththeSegmentSpecs,takealooktounderstandwhattheTrackmethoddoes.Anexamplecallwouldlooklike: analytics.track("MyCustomEvent",{ checkinDate:newDate(), myCoolProperty:"foobar", }); Onouranalytics.jsclient-sideintegrationwesupportallthreedocumentedmethodsofsendingeventstoFacebook. Atanytime,youcandefineacustomcontentTypeontheintegrationoptions.Ifthevalueispresent,itwilltake precedenceoveranyothersettingordefaultvalue. analytics.track('CheckoutStarted',{ revenue:2, products:[{ id:"FB_product_1234", currency:"USD", category:"tshirts", quantity:1, price:2 }] }, {'FacebookPixel':{contentType:'mycustomtype'}} ); StandardEvents TosendStandardevents,usetheSegmentdestinationsettinglabeled“MapYourEventstoStandardFBEvents”.Then,anytimeSegmentreceivesoneoftheeventsinthatmapping,itwillbesenttoFacebookasthestandardeventyouspecified.Allpropertiesyouincludedintheeventwillbesentaseventproperties.Youcanfinddocumentationontheseeventshere. Inaddition,SegmentwillspeciallyhandlethefollowingeventtypesandsendthemasStandardevents: “OrderCompleted”willbesentas“Purchase” “ProductAdded”willbesentas“AddToCart” “ProductListViewed”willbesentas“ViewContent” “ProductViewed”willbesentas“ViewContent” “ProductsSearched”willbesentas“Search” “CheckoutStarted”willbesentas“InitiateCheckout” Facebookrequiresacurrencyfor“Purchase”events–ifyouleaveitout,Segmentwillsetadefaultvalueof“USD”. Youcansetcustompropertiesfortheeventslistedabove.Usethesetting“StandardEventscustomproperties”tolist allthepropertiesyouwanttosend. Hereishowyou’dspecifystandardeventsinthesettingsview: YoucanmapmorethanoneTrackeventtothesameFacebookstandardevent. LegacyEvents TosendLegacyConversionevents,usetheSegmentsettingcalled“LegacyConversionPixelIDs”.AnyeventsthatappearinthatmappingwillbesenttoFacebookwiththespecifiedPixelIDusedastheFacebookPixeleventName.Conversioneventsonlysupportcurrencyandvalueaseventproperties,soonlythesewillbeassociatedwiththeevent.currencywilldefaultto“USD”ifleftout. CustomEvents TosendCustomevents,sendanyeventthatdoesnotappearineithermapping.Allpropertiesyouincludedintheeventwillbeincludedaseventproperties. Timestamps FacebookPixelusesacustomtimestampformat:anISO8601timestampwithouttimezoneinformation.Forthefollowingeventfields,ifyoupassinaJavaScriptDateobject,itwillbeconvertedtothiscustomformat.Ifyoupassinastring,itisassumedthatthestringisalreadyformattedasFacebookexpects: checkinDate checkoutDate departingArrivalDate departingDepartureDate returningArrivalDate returningDepartureDate travelEnd travelStart AdvancedMatching TheSegmentFacebookPixelintegrationsupportsAdvancedMatchingwhichenablesyoutosendyourcustomerdatathroughthepixeltomatchmorewebsiteactionswithFacebookusers.Withthisadditionaldata,youcanreportandoptimizeyouradsformoreconversionsandbuildlargerre-marketingaudiences.Whenthepageloads,beforewefireoffthepixels,we’llcheckfortraitsthattheuserhasbeenpreviouslyidentifiedwithandsendthatalongwitheachcall. Facebookacceptsthefollowingproperties: Firstname Lastname Email Phonenumber Gender Birthday City State Zipcode IfyoufollowSegment’sspec,thesepropertiessendinthecorrectformat. WhenyouuseAdvancedMatching,FacebookalsoacceptsanExternalID.ThiscanbeanyuniqueIDfromtheadvertiser,likeloyaltymembershipIDs,userIDs,andexternalcookieIDs.Tosendanexternal_idtoFacebookyoucaneither: SendtheSegmentuserIdoranonymousIdasexternal_idusingtheUseUserIDorAnonymousIDasExternalIDsetting IndicatewhichusertraityouwouldlikeSegmenttomaptoexternal_idusingtheAdvancedMatchTraitKeyforExternalIDsetting LimitedDataUse InJuly2020,FacebookreleasedLimitedDataUsefeaturetohelpbusinessescomplywiththeCaliforniaConsumerPrivacyAct(CCPA).ThisfeaturelimitsthewayuserdataisstoredandprocessedforallCaliforniaresidentswhooptoutofthesaleoftheirdata.YoucansendLimitedDataUsedataprocessingparameterstoFacebookoneacheventsothatFacebookcanappropriatelyapplytheuser’sdatachoice.SegmentrecommendsthatyoufirstfamiliarizeyourselfonthisfeatureandtheDataProcessingOptionsFacebookaccepts. Thisdestinationsupportsthefollowingparameters: DataProcessingOptions DataProcessingOptionsCountry DataProcessingOptionsState YoucanenablethefeatureusingtheUseLimitedDataUsedestinationsettingandcontrolitusingDataProcessingInitializationParameters. TheUseLimitedDataUsedestinationsettingisdisabledbydefaultforallFacebookdestinationsexceptforFacebookPixel.Thismustbeenabledmanuallyfromthedestinationsettingsifyou’reusingotherFacebookdestinations. DataProcessingDestinationSetting YoucanchangetheUseLimitedDataUsedestinationsettingtoenableordisableLimitedDataUse.Thismustbeenabled(setto“on”)ifyouwanttosenddataprocessingparametersaspartofthetheLimitedDataUsefeature. DataProcessingInitializationParameters TheDataProcessingparametersyousetaretheDataProcessingOptionsSegmentuseswhensendingdatatoFacebook.Bydefault,SegmentusesthefollowingDataProcessingParameters: DataProcessingParameter DefaultValue Whatitmeans DataProcessingOptions ["LDU"] UseFacebook’sLimitedDataUseprocessing DataProcessingOptionsCountry 0 UseFacebook’sgeolocationtodeterminecountry DataProcessingOptionsState 0 UseFacebook’sgeolocationtodeterminestate Facebookusesthecontext.iptodeterminethegeolocationoftheevent. YoucanmanuallychangetheDataProcessingparametersbyaddingsettingstotheintegrationsobject.ForFacebookPixel,youmuststorethesesettingsintheLoadobjectsothatSegmentcansetthembeforeitcallsinit.TheexamplebelowshowshowyoumightsetcustomDataProcessingparametersinAnalytics.js. analytics.load("replace_with_your_write_key",{ integrations:{ 'FacebookPixel':{ dataProcessingOptions:[['LDU'],1,1000] } } }); Settings MapCategoriestoFBContentTypes Ifyou’reusingrealestate,travel,orautomotiveDynamicAdsyoucanmapcategoryvaluestocontent_typevalues.Forexample,youmightmapthecategory“cars”tothe“vehicle”contenttypesoFacebookpromotesrelevantvehiclesfromyourcatalog.Tounderstandwhichcontenttypesyoucanmapto,consulttheFacebookDynamicAdsdocumentation. Formostimplementationswerecommendleavingthesemappingsblank.Bydefault,we’llsetcontent_typeto“product”. Troubleshooting PIIBlocklisting FacebookenforcesstrictguidelinesaroundsendingPersonallyIdentifiableInformation(PII)aspropertiesofPixelevents.Inordertoadheretotheseguidelines,SegmentwillautomaticallyscantrackeventpropertiesforPIIandremoveanythatgetflaggedfromtheeventtoFacebook.Thefollowingkeysarecurrentlyfiltered: email firstName lastName gender city country phone state zip birthday AnytrackeventswithpropertiescontainingthosekeyswillbesenttoFacebookwiththosepropertiesomitted. Ifyouhaveeventsthatuseanyofthosekeysfornon-PIIproperties,youcanmanuallyallowlistthemusingtheAllowlistPIIPropertiessetting.Youmayalsoaddtothislistand/oroptionallyhashblocklistedpropertieswiththeBlocklistPIIPropertiessetting. InconsistentorMissingConversions ThemostcommonreasonforFacebookconversionpixelstofireinconsistentlyisthatthepageredirectsorreloadsbeforethepixelhastimetobeloadedonthepage.Makesureyourpagedoesnotredirectorreloadforatleast300msaftertheconversioneventhappens.Insomecasesadelayof500msisnecessary. WerecommendusingourtrackLinkortrackFormhelperstodelaythepageredirect.Documentationhere.Youcanextendthedelaybysettingthetimeoutto500ms. ExtraorDuplicateConversions Thismaybeduetoconversioneventsbeingsentfromyourdevelopment,staging,ortestingenvironments.Werecommendsettingupseparatesourceforeachenvironment.ThatwayyoucaneitherpointeventstotestconversionpixelsinFacebookConversionTrackingorturnoffFacebookConversionTrackingcompletelyinnon-productionenvironments. Doublecheckthatyourmappedconversioneventsaren’thappeninganywhereelseonyoursite.Iftheuserreloadstheconversionpageorre-triggersthetrackedeventtheymaybedoublecounted. Facebook’sconversionreportscountview-throughconversionsaswellasclick-throughconversionsbydefault.YoucanchangethatsettinginsideFacebookConversionTrackinginthereportattributionsettings. FacebookConversionsNotMatchingGoogleAnalytics Facebookcountsconversionsperperson,asopposedtoGoogleAnalyticswhichcountsperbrowsercookiesession(unlessyou’reusingGoogleAnalyticsUser-ID). IfsomeonesaworclickedonyouradonamobilephonethenlatercamebackdirectlytopurchaseonadesktopmachineGoogleAnalyticswouldn’tknowthatthiswasthesameperson,butFacebookwould.InthatscenarioGoogleAnalyticscounts2uniquevisitswithaconversionlastattributedtoadirectvisitondesktop.Facebookcountsoneconversionwiththeconversionproperlyattributedtothelastadclick/viewonmobile. Scriptunverifiedorundetectedbythird-partytool Manytimesthisisalimitationonthetool’sdetectionprocess,wherethedetectorislookingforaspecificHTMLelementonyourpage.Ourclientsideanalytics.jslibraryasynchronouslyloadsthetool’slibraryorpixelontothepage.Assuch,thedetectionfails. Inordertoconfirmthatthetool’slibraryorpixelisactuallyloadedontothepage,youcanopenupthejavascriptconsoleandgotothenetworktabwhenthepageisloading. Ifthescriptisn’tloading,checkthatanyformofadblockerisdisabled. Settings SegmentletsyouchangethesedestinationsettingsfromtheSegmentappwithouthavingtotouchanycode. Setting Description BlocklistPIIProperties(required) mixed,defaultsto.Facebookhasastrictpolicyprohibitinganypersonallyidentifiableinformation(PII)frombeingsentaspropertiesofeventstotheirAPI.Bydefault,thisintegrationwillscantrackeventsforthesepropertiesandstripthemfromthepayloadthatgetssenttoFacebook.IfyoureventscontainotherpropertieswithPIIvalues,youcanusethissettingtoappendtothisdefaultlist.YoucanalsousethissettingtooptionallyhashanyPIIvaluesinsteadofdroppingthem. MapCategoriestoFBContentTypes(required) text-map,defaultsto{}.Enteryourcategoryvalueontheleft,andtheFacebookcontenttypetomaptoontheright.Facebookrecognizescertaineventtypesthatcanhelpdeliverrelevantads.Ifnocategoryvaluesaremappedwe’lldefaulttoproductandproduct_group,dependingontheevent. EnableAdvancedMatching boolean,defaultstoFALSE.Ifenabled,wewillinitializeFacebookPixelwithanyusertraitsthathavebeencachedintheSegmentcookiesfromyourprevious.identify()calls. AdvancedMatchTraitKeyforExternalID string.PleaseindicateausertraitkeywhichyouwouldlikeSegmenttousetosendanexternal_idtoFacebookPixelusingadvancedmatching.SegmentwillusethevalueofthistraittomapittoFacebookPixel’sexternal_id.Note:EnableAdvancedMatchingmustbeenabledtousethissetting. LegacyConversionPixelIDs text-map,defaultsto{}.TheseareyourdeprecatedConversionPixelIDsfromFacebookConversionTracking.Facebookwillstillacceptdatainthisformat,thoughit’snolongerpossibletocreateconversionPixelIDs.Nowyoucreateconversionsbasedonstandardandcustomeventsinsidetheirinterface.EnteryoureventnameintheleftcolumnandyourpixelIDintherightcolumn. LimitedDataUse(required) boolean,defaultstoTRUE.TheLimitedDataUse(LDU)settingcontrolswhetherornotLimitedDataUsemodeissetintheFBPixelSDK.WhenenablingLDU,SegmentwillsenddefaultusergeographyoptionstorequestthatFacebookgeolocatetheevent.Tooverridethedefaultgeographyoptionssetthevaluesintheanalytics.jsLoadOptionsunderthekeydataProcessingOptions. PixelID(required) string.YourPixelIDfromthesnippetcreatedontheFacebookPixelcreationpage. MapYourEventstoStandardFBEvents(required) map,defaultsto{}.Enteryoureventontheleft,andtheFacebookstandardeventtomaptoontheright.FacebookrecognizescertainstandardeventsthatcanbeusedacrossCustomAudiences,customconversions,conversiontracking,andconversionoptimization.WhenyoumapaneventtoastandardFacebookevent,we’llsendtheeventbythatname.AnyunmappedeventswillstillbesentasCustomEvents. StandardEventscustomproperties(required) array,defaultsto.AddhereallthecustompropertiesyouwanttosendaspartofyourStandardEvents(OrderCompleted,CheckoutStarted,etc)aspropertyname. UseUserIDorAnonymousIDasExternalID boolean,defaultstoFALSE.EnablethissettingifyouwanttosenduserId(oranonymousIdifnotpresent)asexternal_idtoFacebookwhenusingadvancedmatching.Note:EnableAdvancedMatchingmustbeenabledtousethissetting. ValueFieldIdentifier(required) select,defaultstovalue.Forpre-purchaseeventssuchasProductViewedandProductAdded,choosewhichSegmentpropertyyouwouldliketomaptoFacebook’svalueproperty. AllowedPIIProperties array,defaultsto.Bydefault,SegmentwillstripanyPIIfromthepropertiesoftrackeventsthatgetsenttoFacebook.Ifyouwouldliketooverridethisfunctionality,youcaninputeachpropertyyouwouldliketoallowasalineiteminthissetting.Pleasereferenceourdocumentationfortheexactpropertynameswefilterout. Thispagewaslastmodified:11Oct2021 Needsupport? Questions?Problems?Needmoreinfo?Contactus,andwecanhelp! VisitourSupportpage Wasthispagehelpful? Yes No Thanksforyourfeedback! Canweimprovethisdoc?Sendusfeedback! GetstartedwithSegment Segmentistheeasiestwaytointegrateyourwebsites&mobileappsdatatoover300analyticsandgrowthtools. RequestDemo or Createfreeaccount Editthispage Requestdocschange Onthispage OtherFacebookDestinationsSupportedbySegment GettingStarted Page Identify Track LimitedDataUse Settings Troubleshooting Settings Relatedcategories Advertising Wasthispagehelpful? Yes No Thanksforyourfeedback! Canweimprovethisdoc?Sendusfeedback! Send Send Send



請為這篇文章評分?