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 8121495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:30:23+00:00 2026-06-06T05:30:23+00:00

I know this is not the only question out there, but I still couldn’t

  • 0

I know this is not the only question out there, but I still couldn’t find a hint on what’s wrong.

The javascript:

$(function()
{
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-[FILTERED]-1']);
  _gaq.push(['_trackPageview']);

  var ga = document.createElement('script'); ga.type = 'text/javascript'; 
  ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0]; 
  s.parentNode.insertBefore(ga, s);


    $('a[href$=pdf]').each( function() { $(this).attr('target', '_blank'); });
    $('a[href$=pdf]').on('click', function()    { _gaq.push(['_trackEvent', 'Link', 'Click', $(this).attr('href'), 1]); });

});

SO, when inspecting the generated source code (through the webdevelopment toolbar in FF), the javascript libraries are inserted in the following order:

  1. ga
  2. jquery
  3. the page js with the content seen above (1:1)

I don’t get any errors in firebug, page tracking is working fine and inserting debug output after the .push also works, so no “ghost stop”.

I tried to click some pdf files every day for 3 days, and there is nothing in GA registered.

Any ideas?


edit
I tried to debug it with ga_debug.js. Firebug shows the requested images for _trackPageview, but not for _trackEvent. So I tried the following:

$('a[href$=pdf]').each( function() 
{ 
    $(this).attr('target', '_blank'); 
    $(this).attr('onClick', "javascript:_gaq.push(['_trackEvent', 'Link', 'Click', $(this).attr('href'), 1]);");
});

Now the images is requested, but according to firebug, loads forever and won’t complete.

  • 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-06-06T05:30:25+00:00Added an answer on June 6, 2026 at 5:30 am

    Problem solved, apparently you cannot oursource the _gaq part into a file and include it. Adding it directly into the html template works.

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

Sidebar

Related Questions

I know this question is stupid, I searched very hard but still cannot find
I know this probably really simple but Im not sure what im doing wrong...
I know this may not be exactly a coder question, but I feel it
I know this is going to sound silly but I can't find what's wrong.
I know there are several questions about satellite Assembly's out there, but I still
I know this is not programming related, but I have a scenario. Each video
Hey. I know this is not a 'refactor my code' site but I made
I know this question is not really important.. however I've been wondering: Which of
I know this might sounds not reasonable, and might be a bad design. But
I know this sort of code is not best practice, but nevertheless in certain

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.