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

  • Home
  • SEARCH
  • 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 6631321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:31:48+00:00 2026-05-25T22:31:48+00:00

Our application has an issue with tracking google analytics requests. Internal links are not

  • 0

Our application has an issue with tracking google analytics requests. Internal links are not tracked in firefox unless the method that is used to send the request to google is called via a setTimeout. So I had this code working but have been away for a few months to find that a colleague completely changed the config file and removed the setTimeout call. Now when I put the code back in (with additional new variables) I get a js error in the browswer saying that callGA is not defined. Here is my code:

function trackPageview(id, countryCity, unique, bu, bg, areaClick, uri) {
        setTimeout("callGA('" + id + "','" + countryCity + "','" + unique + "','" + bu + "','" + bg + "','" + areaClick + "','" + uri +"')", 1);
    }

    function callGA(id, countryCity, unique, bu, bg, areaClick, uri) {
        _gaq.push([ '_setAccount', id ]);
        _gaq.push([ '_setCustomVar', 1, 'Location', countryCity, 3 ]);
        _gaq.push([ '_setCustomVar', 2, 'Unique', unique, 3 ]);
        _gaq.push([ '_setCustomVar', 3, 'BU', bu, 3 ]);
        _gaq.push([ '_setCustomVar', 4, 'BG', bg, 3 ]);
        _gaq.push([ '_setCustomVar', 5, 'Portlet', areaClick, 3 ]);
        if (uri) { _gaq.push([ '_trackPageview', uri ]); } else { _gaq.push([ '_trackPageview' ]); }
    };

trackPageviews is being called in a number of locations. I have put an alert in here and its fine, the issue is on the setTimeout line.

Any help would be much appreciated.

  • 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-25T22:31:48+00:00Added an answer on May 25, 2026 at 10:31 pm

    Why not put the callGA function inside the setTimeout?

    function trackPageview(id, countryCity, unique, bu, bg, areaClick, uri) {
        setTimeout(function (id, countryCity, unique, bu, bg, areaClick, uri) {
         _gaq.push([ '_setAccount', id ]);
         _gaq.push([ '_setCustomVar', 1, 'Location', countryCity, 3 ]);
         _gaq.push([ '_setCustomVar', 2, 'Unique', unique, 3 ]);
         _gaq.push([ '_setCustomVar', 3, 'BU', bu, 3 ]);
         _gaq.push([ '_setCustomVar', 4, 'BG', bg, 3 ]);
         _gaq.push([ '_setCustomVar', 5, 'Portlet', areaClick, 3 ]);
         if (uri) { 
           _gaq.push([ '_trackPageview', uri ]); 
         } else { 
           _gaq.push([ '_trackPageview' ]); 
         }
       } , 1);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

An issue that has come to light is to open up our application (we
Our application has a file format similar to the OpenDocument file format (see http://en.wikipedia.org/wiki/OpenDocument
Our application has a service layer and a DAO layer, written as Spring beans.
Our application has many controls that are created dynamically. For example, a navigation pane
Our application has a couple of shell scripts that are called from web-based Oracle
Our WinForms application has been reported to occasionally just close on its own. It
Our application runs off MySQL, but a client has another application that requires SQL.
After our Ruby on Rails application has run for a while, it starts throwing
In our application through the process of developing a lot of JAR files has
My company has a ClickOnce application that has been in use with our customers

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.