Bi sawun Mawallafin WordPress A Shafukan AMP A cikin Nazarin Google Tare da ugarin Shafin Farko

Track Wordpress Author Amp Pages Google Analytics With Pagefrog Plugin







Gwada Kayan Aikinmu Don Kawar Da Matsaloli

Kun kasance majagaba a cikin duniyar AMP da WordPress, amma kawai bin diddigin shafi bai isa muku ba. Ee, da Shafukan Facebook Nan take & Shafukan AMP na Google ta PageFrog Kayan aikin WordPress yana sa rayuwar ku ta fi sauƙi, amma ku ne gaske shirye ka keɓe da ƙaunatattun Al'adu a cikin Google Analytics saboda ba a gina aikin ba? Ina ganin ba!







A cikin wannan labarin, zan nuna muku yadda za a aika sunan marubucin post na WordPress zuwa Google Analytics azaman girman al'ada ta amfani da masu canji na AMP Analytics tare da Shafukan Facebook Nan take & Shafukan AMP na Google ta PageFrog plugin.



Don yin wannan aiki, muna buƙatar:



  • Kafa Tsarin Al'amura da ake kira 'marubuci' a cikin Google Analytics
  • Shirya lambar plugin na PageFrog don sanya sunan marubucin post zuwa ga 'marubucin' Custom Dimension a cikin rubutun Google Analytics

Yadda Ake Bibiyar Mawallafin WordPress A Matsayin Tsarin Al'ada A cikin Nazarin Google Tare Da Shafin PageFrog AMP Plugin Don WordPress

  1. Shiga cikin Google Analytics, je sashin ADMIN na asusunku, sannan danna Custom Girma a karkashin taken DUKIYA.
    Sashin Gudanar da Nazarin Google Don Girman Al
  2. Aara Dimira na Musamman da ake kira marubuci kuma matsa Createirƙiri.
  3. Kula da manuniyar marubuci a shafin Al'adar Girma. Wannan shine yadda zamu gaya lambar ƙididdigar wane nau'i don sanya marubucinmu mai canzawa zuwa. A halin da nake ciki, marubuci shine bayanin 1.
  4. Bude fayil din dake/wp-content/plugins/pagefrog/public/partials/amp-google-analytics-template.phpa cikin editan da kuka fi so. Ta hanyar tsoho, fayil ɗin kamar haka:
     { 'vars': { 'account': 'get_google_analytics_site_id() ?>' }, 'triggers': { 'trackPageview' : { 'on': 'visible', 'request': 'pageview' } } } 
  5. Samu sunan marubucin post ɗin WordPress sannan aika shi azaman AMP Analytics Mai canzawa ga Google Analytics azaman Matsayin Al'adu ta hanyar sabunta lambar kamar haka:
     { 'requests': { 'pageviewWithCd1': '${pageview}&cd1=${cd1}' }, 'vars': { 'account': 'get_google_analytics_site_id() ?>' }, 'triggers': { 'trackPageviewWithCustom' : { 'on': 'visible', 'request': 'pageviewWithCd1', 'vars': { 'cd1': 'post_author the_author_meta( 'display_name', $author_id ) ?>' } } } } 

    Mahimminci: Sauya Cd1 da cd1 tare da cd (ƙididdigar tsarin marubucinku na al'ada), kuma ku yi hankali da ƙimar kuɗi

  6. Tabbatar ana saka sunan marubucin a cikin HTML ta hanyar buɗe mai dubawa a cikin Google Chrome kuma duba lambar Google Analytics da ake sakawa bayan buɗewaalama
  7. Tabbatar da lambar AMP tana da inganci ta hanyar buɗe JavaScript console a cikin Google Chrome da ziyartar shafin AMP naka tare# ci gaba = 1an haɗa zuwa url. Idan ka ga 'Amintaccen Ingantaccen AMP.', Kuna da kyau ku tafi.

Mawallafin WordPress: Gano.

Yanzu da ku ke cikakke AMPed saboda kuna bin diddigin kowane marubucin aikin a cikin Google Analytics, taya murna kan kasancewa ɗaya daga cikin ƙila mutane biyu ko uku da suka sami labarin nan mai daɗin karanta shi. Mu masu gabatar da shirin WordPress AMP muna buƙatar tsayawa tare, kuma ina farin ciki da kuka sami amsar da kuke nema anan. Bar sharhi a ƙasa idan yayi aiki. Ko kuma idan ba haka ba.

Godiya ga karatu da duka mafi kyau,
David P.