1. #1
    Sencha User
    Join Date
    Aug 2011
    Location
    Plymouth, UK
    Posts
    137
    Vote Rating
    -2
    simondavies has a little shameless behaviour in the past

      0  

    Question Using analytics within sencha

    Using analytics within sencha


    I knwo I can place my Google Analytics code within the main html page, but is there a way in which I can get further detaield reports as into which view I am currently in etc

  2. #2
    Sencha User
    Join Date
    Aug 2011
    Location
    Plymouth, UK
    Posts
    137
    Vote Rating
    -2
    simondavies has a little shameless behaviour in the past

      0  

    Post


    Well looking through most of my code I have manged to add analytics to both my list and nestedlist views.

    Within the index page I placed the usual analytics code:

    Then at the top of each seperate view js file i placed the following

    Code:
    if(typeof(_gat) !== 'undefined') {
            var pageTracker = _gat._getTracker("UA-????????????");
            pageTracker._initData();
        }
    I simply added the code below to the listeners itemtap method for a normal list as below:

    Code:
    listeners: {
                itemtap: function (list, index, element, event) {
                    var record = this.store.getAt(index);
                    thDetailPanel.update(record.data);
                    App.viewport.setActiveItem(thDetailPanel, {type: 'slide', direction: 'left'});
                    var listObj = this;
                       setTimeout(function(){listObj.deselect(index,true)},1000);
                    var pageLoc = record.data.theatre.replace(/\s+/g, "");
                    pageLoc = pageLoc.replace("&", "");
                    pageLoc = pageLoc.replace("'", "");
                    try{
                        if( pageTracker ){
                            pageTracker._trackEvent('Mobile', pageLoc);
                        }
                    }catch(e){}
                }
    The first couple of 'pageLoc' simply gets the page / list title adn then I screen it to remove any unwanted characters and spaces, before I then add it to the tracking event.

    For the nested list I simply added it to 'getDetailCard' method just before the return.

    Code:
    getDetailCard: function(item, parent) {
           var itemData = item.attributes.record.data,
            parentData = parent.attributes.record.data,
        detailCard = new Ext.Panel({
                            id: 'thdetailpanel',
                            scroll: 'vertical',
                            styleHtmlContent: true,
                            tpl: App.views.groupsPageTpl,
                            layout: 'card',
                            style: 'background: #fff',
            });
            detailCard.update(itemData);
            var pageLoc = parentData.title.replace(/\s+/g, "") + '/' + itemData.title.replace(/\s+/g, "");
            pageLoc = pageLoc.replace("&", "");
            pageLoc = pageLoc.replace("'", "");
            try{
                if( pageTracker ){
                    pageTracker._trackEvent('Mobile', pageLoc);
                }
            }catch(e){}
            return detailCard;
            
        },
    I am just testing so will let you know if all is well and the reports work

  3. #3
    Sencha User
    Join Date
    Aug 2011
    Location
    Plymouth, UK
    Posts
    137
    Vote Rating
    -2
    simondavies has a little shameless behaviour in the past

      0  

    Question


    Well it all reports fine.

    I only have one thign I need to look into and that is I have a simple panel page that is viewed from a link and not a nested list/list so the position of my code simple will not work and placing it into the js will load it up everytime the site loads which is not what I want.

    The js page looks like below:

    Code:
    App.views.panelPage = Ext.extend(Ext.Panel, {
            id:'socialPageLinks',
            scroll: 'vertical',
            styleHtmlContent: true,
            layout: 'card',
            style: 'background: #ffffff',
            dockedItems: [{
                xtype: 'toolbar',
                title: '?????????',
                items: [{xtype: 'spacer'},{iconCls: 'home',  iconMask: true, id: 'homeBtn'}]       
            }],
            html:'my html content',
            layout:'fit'
    });
    
    Ext.reg('panelPage', App.views.panelPage);
    I could do with something like the listener option that detects the page has been selected and the panel details are being viewed, so any ideas on this one let me know, its the final hurdle, but still looking into it

  4. #4
    Sencha User
    Join Date
    Aug 2011
    Location
    Plymouth, UK
    Posts
    137
    Vote Rating
    -2
    simondavies has a little shameless behaviour in the past

      0  

    Question


    Bump!

    I have resolved my issue with a LIst and Nested list But my Issue is now a normal panel view (see below).

    Is there a way to register that this view has been loaded into the main view, so that I can then add my analytics code. Something like 'viewLoaded: {//code here}' I have looked for a listener but they all need an action like tap etc.

    My code is below:

    Code:
    App.views.panelPage = Ext.extend(Ext.Panel, {         id:'socialPageLinks',         scroll: 'vertical',         styleHtmlContent: true,         layout: 'card',         style: 'background: #ffffff',         dockedItems: [{             xtype: 'toolbar',             title: '?????????',             items: [{xtype: 'spacer'},{iconCls: 'home',  iconMask: true, id: 'homeBtn'}]                }],         html:'my html content',         layout:'fit' });  Ext.reg('panelPage', App.views.panelPage);
    I could put the code after the Ext.reg... but this registers as soon as the js page loads on the mau page, which is no good, I only need it to register when the user has clicked and is on the view.

    So somethign like:
    Code:
            html:'my html content',         
            layout:'fit',
            viewLoaded:'place code here'

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar