Google Analytics with ajax

Ornagai မှာ အရင်တုန်းက ပြဿနာ တစ်ခုရှိနေတယ်။ ajax search ပြဿနာပဲ။ Google Analytics က ajax နဲ့ တွဲသုံးလိုက်တိုင်း blank page ကြီးဖြစ်ဖြစ်သွားတယ်။ ဒါနဲ့ မထည့်ဖြစ်ဘူးပေါ့။ အဲဒီတော့ ဘယ်သူတွေ ဘယ်စာလုုံးတွေ ရှာထားလဲဆိုတာကို trace လုပ်ရတာ အရမ်းခက်သွားတယ်။ နောက်ပြီး ဘယ်စာလုံးတွေ ရှာမတွေ့သွားဘူးလဲဆိုတာကို မသိရတော့ဘူး။ ကျွန်တော် အနေနဲ့ ဘယ်စာလုံးတွေ ရှာတယ်ဆိုတာထက် ဘယ်စာလုံးတွေ ရှာမတွေ့သွားဘူးလဲဆိုတာကို ပိုစိတ်ဝင်စားတယ်။ ဒါနဲ့ ဒီနေ့ reinvigorate ကို request ထားတာ accept ရတာနဲ့ Ornagai မှာ ထည့်လိုက်တယ်။ ရှောင်လင် က Google Analytics ပါ မဖြုတ်ဖို့ အကြံပေးတယ်။ ဒါနဲ့ ကျွန်တော်က Google Analytics က ajax ကို trace မရဘူးလို့ ဆိုတော့ သူက ဘာလို့ မရမှာလဲ ဆိုပြီး Link လေး တစ်ခုပေးတယ်။

Example ကတော့ dojo နဲ့ ပြထားတာပဲ။ Google Analytics မှာ pageTracker ဆိုတဲ့ object ပါတာပဲ။ PageTracker ဆိုတဲ့ Object ကို သုံးပြီး ajax မှာ ကြိုက်တဲ့ message ထည့်ပေးလို့ရတာပဲ။ အဲဒီတော့မှ Google Analytics အဲလောက် ကောင်းမှန်းသိတယ်။

[lang name="javascript"]if(pageTracker) {

pageTracker._trackPageview(“#”+message_val);

}[/lang]

_trackPageview ဆိုတဲ့ function ကို သုံးပြီး ကြိုက်တာကို trace လုပ်လို့ရတယ်။ ကျွန်တော့် Ornagai အတွက်တော့ တော်တော် အသုံးဝင်သွားတယ်။ link တွေကို အခု စစ်ကြည့်လို့ရသွားပြီ။ ဘယ်စာလုံးတွေ ရှာမတွေ့သွားဘူးလဲဆိုတာကို ကျွန်တော် trace လိုက်လို့ရပြီ။ Ornagai အတွက်တော့ တော်တော် အသုံးဝင်သွားတယ်။ အခုလို ပြောပြတဲ့ ရှောင်လင်ကို လည်း ကျေးဇူးတင်မိတယ်။

နောက်ဆိုရင် ကျွန်တော် ရှာမတွေ့သွားတဲ့ စာလုံးတွေ ပုံမှန်ထည့်ပေးလို့ရတဲ့အတွက် data တွေ ပိုပြည့်စုံလာမယ်လို့ မျှော်လင့်ရတာပဲဗျာ…

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>