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

Where can I place Statcounter code in a Tabbed Interface?

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

  • Where can I place Statcounter code in a Tabbed Interface?

    I use the Statcounter traffic counting script to check the location and volumn of my visitors. Statcounter really wants you to place their code right before the closing </body></html> tags.

    I can do this with no problem when dealing with an A5w page. My problem is most of my program is made from components (not pages) that are part of a Tabbed interface. I can't seem to find a place in my component where this code will "STICK". Alpha seems to parse it out when it writes the code, or it places it somewhere where it will not work.

    I quess my question is, is there a place in a "COMPONENT" where script code can STICK. I tried in various places including "Under Detail Part" etc. Which takes html okay??? I do not wish to rewrite my program so that all components are contained in an A5W page ( of my own making).

    Any help would be appreciated?

  • #2
    Re: Where can I place Statcounter code in a Tabbed Interface?

    Add this to your javascript code section for the tabbed ui, I think you can put it in the "javascript to run on startup" section, though you could also put it inside <script type="text/javascript"></script> tags in the "User defined 'head' content" property:

    Code:
    jQuery(document).ready( function () {
      jQuery('body').append(' YOUR Statcounter CODE HERE '); // << single quotes, otherwise you have to escape the "
    }
    What this does is register a function to be called when the HTML document is done loading, eg "ready". What will happen is the function you pass to ready() - either in the form function () {...} or functionName - will be called. You can append your statcounter code to the end of the body by using jQuery to get the body tag - jQuery('body') - and then calling append to add the HTML to the end. This will add the HTML at the end of body, just before the closing body tag.

    jQuery ships with Alpha 5, so you do not need to do anything special to add it to your project.

    You can read more about jQuery(document).ready here: http://learn.jquery.com/using-jquery...ocument-ready/

    Note: $ in Alpha5 is NOT a shortcut for jQuery. It is a shortcut for document.getElementById - http://wiki.alphasoftware.com/~alpha...+in+Version+10

    I noticed there is a property for "Footer text". You could try putting your stats code there inside A5 tags: <%a5 ? "all the stats stuff" %>. But I don't know if that will really put that at the very end or just at the bottom before other stuff.

    ---
    Sarah
    Alpha Anywhere latest pre-release

    Comment


    • #3
      Re: Where can I place Statcounter code in a Tabbed Interface?

      Originally posted by TheSmitchell View Post
      Add this to your javascript code section for the tabbed ui, I think you can put it in the "javascript to run on startup" section, though you could also put it inside <script type="text/javascript"></script> tags in the "User defined 'head' content" property:
      Sarah,

      I have no problem placing my code in my primary Tabbed UI A5 PAGE. That's because it is indeed a page where I can see or determine where everything goes because I have control. Maybe I was not clear enough but my problem is placing my code in the numerous TABBED PANES that the UI calls. Those TABBED PANES are mere components. We don't have normal access to parts of that component that can be used for my purpose.

      Please note, Statcounter automatically figures out what page it's on for it's statistics. Trying to re-locate it somewhere else would probably yield a bunch of false positives. This would give me nearly useless information. Kinda like saying you're IN Chicago just because you have someone from Chicago on the phone.

      Tom W.

      Comment


      • #4
        Re: Where can I place Statcounter code in a Tabbed Interface?

        hello

        i am not sure this will help, but there is one property for the tabbed_ui interface.
        it is somewhere in the middle it says about the contained a5w page. there you can customize user defined head content. that is where i keep my favicon etc., see if you can use that area.

        if that is not acceptable you can go to the tabbed_ui_your_component_name in a5w pages and edit that. view in xbasic and go the bottom and see if you can stick the code there.
        it may not stay there forever. you may have to insert if you edit the tabbed_ui component.

        edit: looks like this is not what you are looking for. you are looking to add to the component itself.
        Last edited by GGandhi; 10-07-2013, 09:05 PM.
        thanks for reading

        gandhi

        version 11 3381 - 4096
        mysql backend
        http://www.alphawebprogramming.blogspot.com
        [email protected]
        Skype:[email protected]
        1 914 924 5171

        Comment


        • #5
          Re: Where can I place Statcounter code in a Tabbed Interface?

          Originally posted by GGandhi View Post
          hello

          i am not sure this will help, but there is one property for the tabbed_ui interface.
          it is somewhere in the middle it says about the contained a5w page. there you can customize user defined head content. that is where i keep my favicon etc., see if you can use that area.

          if that is not acceptable you can go to the tabbed_ui_your_component_name in a5w pages and edit that. view in xbasic and go the bottom and see if you can stick the code there.
          it may not stay there forever. you may have to insert if you edit the tabbed_ui component.
          Gandhi,

          Unfortunately, everyone seems to be missing my point and they want to keep pointing back to the Tabbed UI. As I've already stated, I don't have a problem placing the code in the Tabbed UI. No need to repeat explanation here. please re-read previous post(s).

          Tom W.

          Comment


          • #6
            Re: Where can I place Statcounter code in a Tabbed Interface?

            Originally posted by Fulltimer View Post
            Sarah,

            I have no problem placing my code in my primary Tabbed UI A5 PAGE. That's because it is indeed a page where I can see or determine where everything goes because I have control. Maybe I was not clear enough but my problem is placing my code in the numerous TABBED PANES that the UI calls. Those TABBED PANES are mere components. We don't have normal access to parts of that component that can be used for my purpose.

            Please note, Statcounter automatically figures out what page it's on for it's statistics. Trying to re-locate it somewhere else would probably yield a bunch of false positives. This would give me nearly useless information. Kinda like saying you're IN Chicago just because you have someone from Chicago on the phone.

            Tom W.
            You are trying to put the stats code in each tabbed pane? Tab panes are just divs on a page, though. Are you wanting to track each time someone clicks on the tab and count that as a visit? Or just track that someone opened the tab?
            Alpha Anywhere latest pre-release

            Comment


            • #7
              Re: Where can I place Statcounter code in a Tabbed Interface?

              Originally posted by Fulltimer View Post
              I quess my question is, is there a place in a "COMPONENT" where script code can STICK. I tried in various places including "Under Detail Part" etc. Which takes html okay??? I do not wish to rewrite my program so that all components are contained in an A5W page ( of my own making).
              If your script is javascript inside <script> tags, such as google analytics:

              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','//www.google-analytics.com/analytics.js','ga');
              
                    ga('create', '***', '***');
                    ga('send', 'pageview');
              You can just paste that in the Javascript code section - no script tags. It will execute immediately on load. Where you put it doesn't really matter. If timing is a concern --- like, if it needs to load last --- then you'll want to put it inside some event like on render complete or something.

              It looks like script tags are stripped out of the freeform edit regions (which doesn't make any sense) so those won't work.

              If it's not javascript, then you need to append the code to the document using something like onGridInitialize - return js to modify the DOM to add your tracking code.
              Alpha Anywhere latest pre-release

              Comment


              • #8
                Re: Where can I place Statcounter code in a Tabbed Interface?

                Originally posted by TheSmitchell View Post
                You are trying to put the stats code in each tabbed pane? Tab panes are just divs on a page, though. Are you wanting to track each time someone clicks on the tab and count that as a visit? Or just track that someone opened the tab?
                Sarah,

                I think you struck gold!!! I was not aware that panes were "JUST" divs on a page. I guess now that makes sense. Anyway, YES I wanted to track each time a user clicked that tab. I need to know which tabs are more popular than others. If the desire was just a numeric count, I could do that in Xbasic and a database table. However what Statcounter provides is so much more info, like from IP address, returning visits, how long visit etc. I certainly don't want to even try to write that. The info is not THAT critical.

                Anyway, thanks for hanging in there with me. You pulled the "real" problem out of me.

                Tom W.

                Comment


                • #9
                  Re: Where can I place Statcounter code in a Tabbed Interface?

                  Originally posted by Fulltimer View Post
                  Sarah,

                  I think you struck gold!!! I was not aware that panes were "JUST" divs on a page. I guess now that makes sense. Anyway, YES I wanted to track each time a user clicked that tab. I need to know which tabs are more popular than others. If the desire was just a numeric count, I could do that in Xbasic and a database table. However what Statcounter provides is so much more info, like from IP address, returning visits, how long visit etc. I certainly don't want to even try to write that. The info is not THAT critical.

                  Anyway, thanks for hanging in there with me. You pulled the "real" problem out of me.

                  Tom W.
                  They are. A5W pages in tabs are a little different. They're actually embedded in iframes - so your tracking code would sort of work there I suppose. There IS an iframe associated with every tab pane, but I've yet to see grids & dialogs appear inside those iframes. They usually appear inside nested div elements.

                  You supposedly have all the source for this tracking software. The google stuff I quoted has 2 functions: "create" and "send view". If I wanted to track each tab visit as a new "page view", I would just call those two functions every time a tab was visited - there are events for that client-side. If you're willing to put in the effort, you could probably figure out how to adapt Statcounter's API to your needs. I recommend a javascript deminifier if you go that route - assuming it's .js. Firefox plugin FireBug is a great plugin for investigating the DOM - recommended. And there are some other Firefox plugins out there for deminifying js files. Also recommended - it's great for making A5.js files readable.

                  Good luck
                  ---
                  Sarah
                  Alpha Anywhere latest pre-release

                  Comment


                  • #10
                    Re: Where can I place Statcounter code in a Tabbed Interface?

                    Gandhi,

                    Unfortunately, everyone seems to be missing my point and they want to keep pointing back to the Tabbed UI. As I've already stated, I don't have a problem placing the code in the Tabbed UI. No need to repeat explanation here. please re-read previous post(s).

                    Tom W.
                    right after I posted I noticed what you wanted and I edited my original post to reflect that.

                    I quess my question is, is there a place in a "COMPONENT" where script code can STICK.
                    for each component in the tabbed_ui there is a property for the pane. tab pane javascript/ on initial. I think that is a good place to place your javascript, that should run when the pane is initialized.

                    actually statcounter may be useful for me. I will download and check its usage.
                    thanks for reading

                    gandhi

                    version 11 3381 - 4096
                    mysql backend
                    http://www.alphawebprogramming.blogspot.com
                    [email protected]
                    Skype:[email protected]
                    1 914 924 5171

                    Comment

                    Working...
                    X