Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7059781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:16:25+00:00 2026-05-28T04:16:25+00:00

jQueryMobile loads its first page as every site does. The usual Google Analytics integration

  • 0

jQueryMobile loads its first page as every site does. The usual Google Analytics integration works – the request ist tracked. But following pages are loaded asynchronously and user clicks are not tracked.

How to integrate Google Analytics into a jQueryMobile website, so that all page clicks are tracked?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:16:25+00:00Added an answer on May 28, 2026 at 4:16 am

    Jon Gales has written a great article on this.

    http://www.jongales.com/blog/2011/01/10/google-analytics-and-jquery-mobile/

    Here’s the code he recommends using:

    $('[data-role=page]').live('pageshow', function (event, ui) {
        try {
            _gaq.push(['_setAccount', 'YOUR_GA_ID']);
    
            hash = location.hash;
    
            if (hash) {
                _gaq.push(['_trackPageview', hash.substr(1)]);
            } else {
                _gaq.push(['_trackPageview']);
            }
        } catch(err) {
    
        }
    
    });
    

    Update

    Since live is now deprecated you should use the on event instead, if you´re using jQuery 1.7+. http://api.jquery.com/on/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In jqueryMobile, only the first page section seems to be loaded. When the user
It's a known fact that jQueryMobile loads pages with ajax and is not including
My html page loads beautifully, but I have some JavaScript that adds a few
I am trying to set Google Chart using API generated from below link Google
I'm working on a mobile view of our site. I'm trying to implement JQuery
In order to load a jQuery mobile page using an anchor tag, one just
My jQuery Mobile app consists of a single index.html page and contains only one
I am converting an existing ASP.NET website to use jQuery Mobile controls. The first
This works: <script src=http://code.jquery.com/jquery-1.5.min.js type=text/javascript></script> <script src=http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js type=text/javascript></script> But I prefer the syntax: <script
I'm using jQuery Mobile and trying to figure out how to change a page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.