Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Google Analytics for each PanelCard in UX

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Google Analytics for each PanelCard in UX

    Hi All,

    I am exploring including Google Analytics in my browser application and have run into a bit of an issue.

    My application consists of one (1) UX component with multiple panelcards that represents different 'pages'.

    The issue is that Google Analytics views my single UX component as one page whereas I need to track visits to each panelcard separately.

    Is there a way to identify to Google Analytics that when the active panelcard changes this is a new page?

    I hope my question is clear and thanks in advance for any suggestions.

  • #2
    Re: Google Analytics for each PanelCard in UX

    RESOLVED

    See Documentation Here for Single Page Applications with Google Analytics:
    https://developers.google.com/analyt...e-applications

    Each time the active panelcard changes I update the page information sent to Google Analytics.

    My code looks like this:

    Code:
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
    
      ga('create', '***********', 'auto');
      ga('set', 'page', '/HOME-PAGE');
      ga('send', 'pageview');
      
     var panel = {dialog.object}.panelGetActive();
     
     if (panel == 'FAQ') {
     	ga('set', 'page', '/FAQ-PAGE');
     	ga('send', 'pageview');
     }

    Comment


    • #3
      Re: Google Analytics for each PanelCard in UX

      Very Cool!

      Comment


      • #4
        Re: Google Analytics for each PanelCard in UX

        Agreed... very cool.

        Comment


        • #5
          Re: Google Analytics for each PanelCard in UX

          Agreed-this is one of those things I will file in my brain for later retrieval!
          NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

          Comment


          • #6
            Re: Google Analytics for each PanelCard in UX

            Clever

            Comment


            • #7
              Re: Google Analytics for each PanelCard in UX

              where do you guys put the code above? Just code/javascript functions of the parent UX? Or does it go somewhere else? What makes it fire every time the panel changes?

              Comment


              • #8
                Re: Google Analytics for each PanelCard in UX

                Originally posted by carlbsmith View Post
                where do you guys put the code above? Just code/javascript functions of the parent UX? Or does it go somewhere else? What makes it fire every time the panel changes?
                I have a panelnavigator on my UX. There is an onPanelActivate listed in the Javascript section of the properties menu that is where I put it.

                Comment


                • #9
                  Re: Google Analytics for each PanelCard in UX

                  Laura-Kae,
                  Have you seen anything in Google Analytics, or else where, that lets you inject some Javascript code to track how many times AA server fails to respond to requests?

                  Comment


                  • #10
                    Re: Google Analytics for each PanelCard in UX

                    Originally posted by RichCPT View Post
                    Laura-Kae,
                    Have you seen anything in Google Analytics, or else where, that lets you inject some Javascript code to track how many times AA server fails to respond to requests?
                    Unfortunately I'm no help there. I haven't explored Google analytics that deeply.

                    Comment


                    • #11
                      Re: Google Analytics for each PanelCard in UX

                      Very refreshing to see this great work. - Well done.
                      Insanity: doing the same thing over and over again and expecting different results.
                      Albert Einstein, (attributed)
                      US (German-born) physicist (1879 - 1955)

                      Comment


                      • #12
                        Re: Google Analytics for each PanelCard in UX

                        I implemented this code, in my Phonegap Build UX it throws the attached error. Looks like a plugin problem, does a new plugin have to be installed? I marked out some identifiers

                        error.jpg
                        Last edited by swest; 03-29-2018, 01:30 PM.

                        Comment


                        • #13
                          Re: Google Analytics for each PanelCard in UX

                          I'm not seeing the Google Analytics update, even after playing around in the app and waiting a full 24 hours. I am quite familiar with Google Analytics, and have used it in the past, but never in a UX. Can someone glance at my code below and make sure it is correct. I have starred out my UA number for this post, that is intentional. I have a panel navigator, and under 'onPanelActive', I have the following code:


                          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
                          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
                          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
                          })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

                          ga('create', 'UA-*********-1', 'auto');
                          ga('set', 'page', '/HOME-PAGE');
                          ga('send', 'pageview');

                          var panel = {dialog.object}.panelGetActive();

                          if (panel == 'PANEL_APPLICATION') {
                          ga('set', 'page', '/HOME-PAGE');
                          ga('send', 'pageview');
                          }

                          if (panel == 'APPLICATION_DETAILS') {
                          ga('set', 'page', '/APPLICATION_DETAILS-PAGE');
                          ga('send', 'pageview');
                          }

                          if (panel == 'PANEL_CAMERAS') {
                          ga('set', 'page', '/CAMERAS-PAGE');
                          ga('send', 'pageview');
                          }

                          if (panel == 'PANEL_LENSES') {
                          ga('set', 'page', '/LENSES-PAGE');
                          ga('send', 'pageview');
                          }

                          if (panel == 'PANEL_RECORDERS') {
                          ga('set', 'page', '/RECORDERS-PAGE');
                          ga('send', 'pageview');
                          }

                          if (panel == 'PANEL_POWER') {
                          ga('set', 'page', '/POWER-PAGE');
                          ga('send', 'pageview');
                          }

                          if (panel == 'PANEL_MIDSPANS') {
                          ga('set', 'page', '/MIDSPANS-PAGE');
                          ga('send', 'pageview');
                          }

                          if (panel == 'PANEL_MONITORS') {
                          ga('set', 'page', '/MONITORS-PAGE');
                          ga('send', 'pageview');
                          }

                          if (panel == 'PANEL_ENCODERS') {
                          ga('set', 'page', '/ENCODERS-PAGE');
                          ga('send', 'pageview');
                          }

                          if (panel == 'PANEL_CARDPRINTERS') {
                          ga('set', 'page', '/CARDPRINTERS-PAGE');
                          ga('send', 'pageview');
                          }


                          if (panel == 'PANEL_CARDPRINTER_ACCESSORIES') {
                          ga('set', 'page', '/CARDPRINTER_ACCESSORIES-PAGE');
                          ga('send', 'pageview');
                          }



                          if (panel == 'PANEL_SWITCHES') {
                          ga('set', 'page', '/SWITCHES-PAGE');
                          ga('send', 'pageview');
                          }

                          if (panel == 'PANEL_WIRELESS') {
                          ga('set', 'page', '/WIRELESS-PAGE');
                          ga('send', 'pageview');
                          }

                          if (panel == 'PANEL_CABLE') {
                          ga('set', 'page', '/CABLE-PAGE');
                          ga('send', 'pageview');
                          }

                          if (panel == 'CONTACTSALES_TERRITORY') {
                          ga('set', 'page', '/SALES_TERRITORY-PAGE');
                          ga('send', 'pageview');
                          }

                          if (panel == 'CONTACTSALES_INDIVIDUAL') {
                          ga('set', 'page', '/SALES_INDIVIDUAL-PAGE');
                          ga('send', 'pageview');
                          }



                          if (panel == 'PANEL_CONFIGVIDEO') {
                          ga('set', 'page', '/CONFIGVIDEO-PAGE');
                          ga('send', 'pageview');
                          }

                          if (panel == 'PANEL_CONFIGACCESS') {
                          ga('set', 'page', '/CONFIGACCESS-PAGE');
                          ga('send', 'pageview');
                          }

                          if (panel == 'PANEL_CONFIGWIRELESS') {
                          ga('set', 'page', '/CONFIGWIRELESS-PAGE');
                          ga('send', 'pageview');
                          }

                          if (panel == 'PANEL_WARRANTYDOA') {
                          ga('set', 'page', '/WARRANTYDOA-PAGE');
                          ga('send', 'pageview');
                          }


                          if (panel == 'PANEL_BSCALCULATOR') {
                          ga('set', 'page', '/BSCALCULATOR-PAGE');
                          ga('send', 'pageview');
                          }


                          if (panel == 'PANEL_FOVCALCULATOR') {
                          ga('set', 'page', '/FOVCALCULATOR-PAGE');
                          ga('send', 'pageview');
                          }


                          if (panel == 'PANEL_VDCALCULATOR') {
                          ga('set', 'page', '/VDCALCULATOR-PAGE');
                          ga('send', 'pageview');
                          }

                          Comment


                          • #14
                            Re: Google Analytics for each PanelCard in UX

                            I modified my code to use else if statements. Now what I have looks like this:


                            (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
                            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
                            m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
                            })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

                            ga('create', 'UA-****-1', 'auto');
                            ga('set', 'page', '/HOME-PAGE');
                            ga('send', 'pageview');

                            var panel = {dialog.object}.panelGetActive();

                            if (panel == 'PANEL_APPLICATION') {
                            ga('set', 'page', '/HOME-PAGE');
                            ga('send', 'pageview');
                            } else if (panel == 'APPLICATION_DETAILS') {
                            ga('set', 'page', '/APPLICATION_DETAILS-PAGE');
                            ga('send', 'pageview');
                            } else if (panel == 'PANEL_CAMERAS') {
                            ga('set', 'page', '/CAMERAS-PAGE');
                            ga('send', 'pageview');
                            } else if (panel == 'PANEL_LENSES') {
                            ga('set', 'page', '/LENSES-PAGE');
                            ga('send', 'pageview');
                            } else if (panel == 'PANEL_RECORDERS') {
                            ga('set', 'page', '/RECORDERS-PAGE');
                            ga('send', 'pageview');
                            } else if (panel == 'PANEL_POWER') {
                            ga('set', 'page', '/POWER-PAGE');
                            ga('send', 'pageview');
                            } else if (panel == 'PANEL_MIDSPANS') {
                            ga('set', 'page', '/MIDSPANS-PAGE');
                            ga('send', 'pageview');
                            } else if (panel == 'PANEL_MONITORS') {
                            ga('set', 'page', '/MONITORS-PAGE');
                            ga('send', 'pageview');
                            } else if (panel == 'PANEL_ENCODERS') {
                            ga('set', 'page', '/ENCODERS-PAGE');
                            ga('send', 'pageview');
                            } else if (panel == 'PANEL_CARDPRINTERS') {
                            ga('set', 'page', '/CARDPRINTERS-PAGE');
                            ga('send', 'pageview');
                            } else if (panel == 'PANEL_CARDPRINTER_ACCESSORIES') {
                            ga('set', 'page', '/CARDPRINTER_ACCESSORIES-PAGE');
                            ga('send', 'pageview');
                            } else if (panel == 'PANEL_SWITCHES') {
                            ga('set', 'page', '/SWITCHES-PAGE');
                            ga('send', 'pageview');
                            } else if (panel == 'PANEL_WIRELESS') {
                            ga('set', 'page', '/WIRELESS-PAGE');
                            ga('send', 'pageview');
                            } else if (panel == 'PANEL_CABLE') {
                            ga('set', 'page', '/CABLE-PAGE');
                            ga('send', 'pageview');
                            } else if (panel == 'CONTACTSALES_TERRITORY') {
                            ga('set', 'page', '/SALES_TERRITORY-PAGE');
                            ga('send', 'pageview');
                            } else if (panel == 'CONTACTSALES_INDIVIDUAL') {
                            ga('set', 'page', '/SALES_INDIVIDUAL-PAGE');
                            ga('send', 'pageview');
                            } else if (panel == 'PANEL_CONFIGVIDEO') {
                            ga('set', 'page', '/CONFIGVIDEO-PAGE');
                            ga('send', 'pageview');
                            } else if (panel == 'PANEL_CONFIGACCESS') {
                            ga('set', 'page', '/CONFIGACCESS-PAGE');
                            ga('send', 'pageview');
                            } else if (panel == 'PANEL_CONFIGWIRELESS') {
                            ga('set', 'page', '/CONFIGWIRELESS-PAGE');
                            ga('send', 'pageview');
                            } else if (panel == 'PANEL_WARRANTYDOA') {
                            ga('set', 'page', '/WARRANTYDOA-PAGE');
                            ga('send', 'pageview');
                            } else if (panel == 'PANEL_BSCALCULATOR') {
                            ga('set', 'page', '/BSCALCULATOR-PAGE');
                            ga('send', 'pageview');
                            } else if (panel == 'PANEL_FOVCALCULATOR') {
                            ga('set', 'page', '/FOVCALCULATOR-PAGE');
                            ga('send', 'pageview');
                            } else if (panel == 'PANEL_VDCALCULATOR') {
                            ga('set', 'page', '/VDCALCULATOR-PAGE');
                            ga('send', 'pageview');
                            }


                            I am seeing some activity in the Google Analytics dashboard, but not fully what I was expecting. It doesn't seem to be showing me statistics around the different panel cards being viewed. Does the code above look correct? Or am I missing something?

                            Comment


                            • #15
                              Re: Google Analytics for each PanelCard in UX

                              I will take a look at this, but I think the problem is that Google doesn't "see" a UX panel as a page, even if you tell it that it is a page. So, there might be something else that you have to do to make it "see" the the panel as a new "page". This is my best guestimate until I can try and test it.

                              I wonder if it has something to do with local storage properties? See code below from StackOverflow:

                              // THIS IS FOR LOCALSTORAGE
                              var GA_LOCAL_STORAGE_KEY = 'ga:clientId';
                              ga('create', 'UA-XXXXX-Y', {
                              'storage': 'none',
                              'clientId': localStorage.getItem(GA_LOCAL_STORAGE_KEY)
                              });
                              ga(function(tracker) {
                              localStorage.setItem(GA_LOCAL_STORAGE_KEY, tracker.get('clientId'));
                              });

                              // THIS IS FOR FILE URL SUPPORT
                              ga('set', 'checkProtocolTask', function(){ /* noop */});

                              // And then as usual...
                              ga('send', 'pageview');

                              Comment

                              Working...
                              X