facebook

Google Analytics – 3 easy step to a working solution

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #345554 Reply

    Hi everyone

    Finaly I have a very easy 3 step solution 🙂

    1. Create a google Analytics account and choose website property (it is VERY important NOT to chose Mobileapp)

    2. Download, include analytics.js in your app. It can be found here:

    http://www.google-analytics.com/analytics.js

    Open analytics.js and modify the file – remove the code that aborts itself when it doesn’t see either the http or https protocol.

    Search for: if(“http:”!=a&&”https:”!=a)throw”abort”;

    Modyfy it this way:
    Before: if(“http:”!=a&&”https:”!=a)throw”abort”;
    After: //if(“http:”!=a&&”https:”!=a)throw”abort”;

    3. Put this code in your pagename-custom.js under:

    '
    phoneui.prePageTransition = function(currentScreenId,targetScreenId) {'
    
        
    Google analytics->
    ga('create', 'UA-xxxxxxxx-yy', {
    'storage': 'none',
    'clientId': window.localStorage.getItem('devId') //Be shure this is a uniq ID eg. use email or device.uuid
    });
    
    ga('send', 'pageview', {'page':targetScreenId});
    Google analytics<-
    

    Thats it!

    #345920 Reply

    See working solution above.

    #349337 Reply

    fbod383
    Member

    Sooo.. you just copy and paste the info from the http://www.google-analytics.com/analytics.js? how do you track it?

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Google Analytics – 3 easy step to a working solution

You must be logged in to post in the forum log in