Umeng add page statistics, umeng page

Source: Internet
Author: User

Umeng add page statistics, umeng page

Umeng's statistics are still quite powerful. Although the project does not require relevant functions, related statistics are still added, and a line of code must be added to viewWillAppear and viewWillDisappear in the corresponding ViewController, input the name of the current page. At first, only a few pages are added, so the code is written to death. To add statistics to all pages, you need to improve the Code and encapsulate it in your own BaseViewController.

 

-(Void) beginLogPageView

{

[MobClick beginLogPageView: NSStringFromClass ([self class])];

}

 

-(Void) endLogPageView;

{

[MobClick endLogPageView: NSStringFromClass ([self class])];

}

 

It is easy to call statistics on the subpage.

-(Void) viewWillAppear :( BOOL) animated {

[Super viewWillAppear: animated];

// Add page statistics

[Self beginLogPageView];

}

-(Void) viewWillDisappear :( BOOL) animated {

[Super viewWillDisappear: animated];

// End page statistics

[Self endLogPageView];

}

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.