How to Pull Ecommerce Data From Data Layer in GTM

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

You can navigate to any of the product pages on your website and then click on the 'Datalayer Checker' extension to validate if the product ... Home About Testimonials Services GoogleAnalytics&GTMConsulting DigitalAnalyticsTraining Blog Books DigitalAnalyticsTraining Contact HowtoPullEcommerceDataFromDataLayerinGTM GoogleTagManager LastUpdated:January13,2022 TableofContentsforHowtoPullEcommerceDataFromDataLayerinGTM  [show]PrerequisitesforpullingecommercedatafromthedatalayerUnderstandingtheecommercedatalayerFrequentlyaskedquestionsabouthowtopullecommercedatafromthedatalayerinGTM IfyouareusingGoogleTagManagerforimplementingenhancedecommercetrackingonyourwebsite,thedatalayeristhesinglesourceoftruththatdefinesyourwebsite-relateddata,ecommercedata,campaigndataanduserdataaswell.  Prerequisitesforpullingecommercedatafromthedatalayer YoumusthaveanecommercewebsiteYouhavedeployeddatalayeronthewebsiteGoogleTagManagerisinstalledonyourwebsiteGoodknowledgeofHTML,DOMandJavaScriptGoodunderstandingofGTMvariablesandtriggersDatalayerCheckerChromeextensionisinstalledinyourbrowser Note:Ifyouarebrandnewtotheconceptofthedatalayer,thencheckoutthefollowingarticlefirst:GoogleTagManagerDataLayerTutorialwithExamples MyStep-By-StepBlueprint(100+Pages)ForLearningandMasteringGTMDataLayers GetTheOnlyEbookOnGTMDataLayerEverPublished(100+pages).Learn&MasterDataLayers YesIwanttheebook Understandingtheecommercedatalayer Duringanyecommerceeventslikeproductimpression,productclick,addtocart,checkout,andtransaction,thedatalayerisupdatedinthebackendusingthe‘datalayer.push()’method.  Asampledatalayercodewhentheproductdetailvieweventhappenswilllooklikebelow: Youcannavigatetoanyoftheproductpagesonyourwebsiteandthenclickonthe‘DatalayerChecker’extensiontovalidateiftheproductdetailviewispushedtothedatalayer. Youshouldseethe‘productDetail’eventmarkedinayellowcircle.Thisisthesamedatalayervariable‘event’thatwehavedeclaredintheabovecode. Nowclickonthe‘productDetail’eventtoseetheexactdetailspassed. Asyoucanseeintheimageabove,thedatalayerispopulatedwithecommercedetails.  FollowthestepsbelowtopullecommercedatafromthedatalayerinGTM Step-1:NavigatetoyourGTMcontainerandclickon‘Variables’ Step-2:Clickon‘New’under‘User-DefinedVariables’.  Step-3:Selectthevariabletypeas‘DataLayerVariable’. Step-4:Nameyourvariableas“ProductName”andenter“product.name”inthe‘DataLayerVariableName’field. Step-5:SavethevariableandsimilarlycreateothervariablesProductID,ProductPrice,ProductCategory Step-6:PutyourGTMcontainerinpreviewmodeandvisittheproductpageagain. Step-7:Selectthe‘productDetail’eventfromthesummarytabavailableinthepreviewwindowandthenclickon‘Variable’. Step-8:Checkforthedatalayervariablesthatyouhavecreatedintheearliersteps. Youshouldseethatthevariablesarepopulatedwiththedatalayervalues. Congratulations!YouhavesuccessfullypulledecommercedatafromthedatalayerinGTM. Similarly,youcancreatecustomdatalayervariablesforotherecommercedataaswelllike,productquantity,shippingamount,transactionid,revenue,etc.YoucanusethesevariablestosenddatatoyourGoogleAnalyticstagsaswellasotherthirdpartytagslikeFacebook,Linkedin,etc. FrequentlyaskedquestionsabouthowtopullecommercedatafromthedatalayerinGTM WhydoweneedtopullecommercedatafromthedatalayerinGTM? Thedatalayeristhesinglesourceoftruththatdefinesyourwebsite-relateddata,ecommercedata,campaigndataanduserdataaswell. IfyouareusingGoogleTagManager,youcansendtheecommercedatafromthedatalayerinGTMandthenforwardittoanotheranalyticstoolsuchasGoogleAnalytics,Facebook,Linkedin,Twitter,etc. Whatisadatalayerpushandwhyisitneeded?  “datalayer.push()”iscodethatallowsyoutoupdatedatastoredinthedatalayer.Let’ssupposeyouhaveanecommercewebsiteandwanttotrackecommercetransactions.Aseverytransactionidwillbeuniqueandwillbegeneratedonlywhentheusercompletesthepurchase. ThiskindofdatacannotbedirectlyaccessedfromGTM.Herethe“datalayer.push()”codeupdatesthedatalayerinreal-timeandthenonlythetransactionidwillbemadeavailableinGTMforfurtheruse. Canyouoverwritetheecommercedatalayervariables?  Yes,youcan,bypushingavariableofthesamenameasanexistingvariable,butwithanewvaluetothedatalayer.Letussupposeyourexistingdatalayercontainsaproductquantityvariableanditscurrentvalueis4: Nowifuseraddsonemoreproducttocart,youcanusethepushmethod,liketheonebelow: ThevalueofproductQuantitydatalayervariablewouldbeoverwrittenanditsnewvaluewillbe5. RegisterfortheFREETRAINING... "HowtouseDigitalAnalyticstogeneratefloodsofnewSalesandCustomerswithoutspendingyearsfiguringeverythingoutonyourown." Here’swhatwe’regoingtocoverinthistraining… #1Whydigitalanalyticsisthekeytoonlinebusinesssuccess. ​#2Thenumber1reasonwhymostmarketersarenotabletoscaletheiradvertisingandmaximizesales. #3WhyGoogleandFacebookadsdon’tworkformostbusinesses&howtomakethemwork. #4​Whyyouwon’tgetanycompetitiveadvantageinthemarketplacejustbyknowingGoogleAnalytics. ​#5Thenumber1reasonwhyconversionoptimizationisnotworkingforyourbusiness. ​#6HowtoadvertiseonanymarketingplatformforFREEwithanunlimitedbudget. ​#7Howtolearnandmasterdigitalanalyticsandconversionoptimizationinrecordtime.     MybestsellingbooksonDigitalAnalyticsandConversionOptimization MathsandStatsforWebAnalyticsandConversionOptimization Thisexpertguidewillteachyouhowtoleveragetheknowledgeofmathsandstatisticsinordertoaccuratelyinterpretdataandtakeactions,whichcanquicklyimprovethebottom-lineofyouronlinebusiness. MastertheEssentialsofEmailMarketingAnalytics Thisbookfocusessolelyonthe‘analytics’thatpoweryouremailmarketingoptimizationprogramandwillhelpyoudramaticallyreduceyourcostperacquisitionandincreasemarketingROIbytrackingtheperformanceofthevariousKPIsandmetricsusedforemailmarketing. AttributionModellinginGoogleAnalyticsandBeyondSECONDEDITIONOUTNOW! Attributionmodellingistheprocessofdeterminingthemosteffectivemarketingchannelsforinvestment.Thisbookhasbeenwrittentohelpyouimplementattributionmodelling.Itwillteachyouhowtoleveragetheknowledgeofattributionmodellinginordertoallocatemarketingbudgetandunderstandbuyingbehaviour. AttributionModellinginGoogleAdsandFacebook ThisbookhasbeenwrittentohelpyouimplementattributionmodellinginGoogleAds(GoogleAdWords)andFacebook.Itwillteachyou,howtoleveragetheknowledgeofattributionmodellinginordertounderstandthecustomerpurchasingjourneyanddeterminethemosteffectivemarketingchannelsforinvestment. AbouttheAuthor HimanshuSharma Founder,OptimizeSmart.com Over15yearsofexperienceindigitalanalyticsandmarketing Authoroffourbest-sellingbooksondigitalanalyticsandconversionoptimization NominatedforDigitalAnalyticsAssociationAwardsforExcellence Runsoneofthemostpopularblogsintheworldondigitalanalytics Consultanttocountlesssmallandbigbusinessesoverthedecade error:Alert:Contentisprotected!! Weusecookiesonourwebsitetogiveyouthemostrelevantexperiencebyrememberingyourpreferencesandrepeatvisits.Byclicking“AllowCookies”,youconsenttotheuseofALLthecookies.However,youmayvisit"CookieSettings"toprovideacontrolledconsent.CookieSettingsAllowCookiesManageconsent Close PrivacyOverview Thiswebsiteusescookiestoimproveyourexperiencewhileyounavigatethroughthewebsite.Outofthese,thecookiesthatarecategorizedasnecessaryarestoredonyourbrowserastheyareessentialfortheworkingofbasicfunctionalitiesofthewebsite.Wealsousethird-partycookiesthathelpusanalyzeandunderstandhowyouusethiswebsite.Thesecookieswillbestoredinyourbrowseronlywithyourconsent.Youalsohavetheoptiontoopt-outofthesecookies.Butoptingoutofsomeofthesecookiesmayaffectyourbrowsingexperience. Necessary Necessary AlwaysEnabled Necessarycookiesareabsolutelyessentialforthewebsitetofunctionproperly.Thesecookiesensurebasicfunctionalitiesandsecurityfeaturesofthewebsite,anonymously. CookieDurationDescriptioncookielawinfo-checkbox-analytics11monthsThiscookieissetbyGDPRCookieConsentplugin.Thecookieisusedtostoretheuserconsentforthecookiesinthecategory"Analytics".cookielawinfo-checkbox-functional11monthsThecookieissetbyGDPRcookieconsenttorecordtheuserconsentforthecookiesinthecategory"Functional".cookielawinfo-checkbox-necessary11monthsThiscookieissetbyGDPRCookieConsentplugin.Thecookiesisusedtostoretheuserconsentforthecookiesinthecategory"Necessary".cookielawinfo-checkbox-others11monthsThiscookieissetbyGDPRCookieConsentplugin.Thecookieisusedtostoretheuserconsentforthecookiesinthecategory"Other.cookielawinfo-checkbox-performance11monthsThiscookieissetbyGDPRCookieConsentplugin.Thecookieisusedtostoretheuserconsentforthecookiesinthecategory"Performance".viewed_cookie_policy11monthsThecookieissetbytheGDPRCookieConsentpluginandisusedtostorewhetherornotuserhasconsentedtotheuseofcookies.Itdoesnotstoreanypersonaldata. Functional functional Functionalcookieshelptoperformcertainfunctionalitieslikesharingthecontentofthewebsiteonsocialmediaplatforms,collectfeedbacks,andotherthird-partyfeatures. Performance performance Performancecookiesareusedtounderstandandanalyzethekeyperformanceindexesofthewebsitewhichhelpsindeliveringabetteruserexperienceforthevisitors. Analytics analytics Analyticalcookiesareusedtounderstandhowvisitorsinteractwiththewebsite.Thesecookieshelpprovideinformationonmetricsthenumberofvisitors,bouncerate,trafficsource,etc. Advertisement advertisement Advertisementcookiesareusedtoprovidevisitorswithrelevantadsandmarketingcampaigns.Thesecookiestrackvisitorsacrosswebsitesandcollectinformationtoprovidecustomizedads. Others others Otheruncategorizedcookiesarethosethatarebeinganalyzedandhavenotbeenclassifiedintoacategoryasyet. Save&Accept



請為這篇文章評分?