Welcome to WebmasterWorld Guest from

Forum Moderators: DixonJones & mademetop

Message Too Old, No Replies

google analytics code slowing down links

5:29 pm on Nov 21, 2011 (gmt 0)

New User

10+ Year Member

joined:July 13, 2005
votes: 0


Our website is setup so that any link clicked within "domain.com/Referrals/" is counted as a goal. Currently, every html file in this /Referrals/ directory has the google analytics code directly in the file. This tracks goals and pageviews just fine, however, it is adding significant load times (2-3 seconds) when any link is clicked. We have looked at our files and they just simple redirects, and I think it hangs for a few seconds while loading the GA code.

My question is - Is there anyway to decrease this load time? Is this standard or could there be another reason why I am experiencing this extra few seconds of load time?

12:32 am on Nov 24, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member tangor is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Nov 29, 2005
votes: 537

Anytime code is loaded from a third party there is the possibility of increased delay. I don't know of a way to reduce that time.
6:48 pm on Nov 25, 2011 (gmt 0)

New User

10+ Year Member

joined:July 13, 2005
votes: 0

Yeah not sure if it's possible or if there is anything we can do about that. I guess I'm wondering if it's standard to have this extra few seconds of load while calling the GA code.
7:30 pm on Nov 28, 2011 (gmt 0)

New User

5+ Year Member

joined:Nov 28, 2011
votes: 0


You might want to take a look into event tracking. See the below example of event tracking attached to a link. This shouldn't take multiple seconds to track referrals.

<a href="http://www.webmasterworld.com/" onClick="_gaq.push(['_trackEvent', 'Referrals', 'Click', 'Referral name']);">Anchor</a>

You can use events to set-up goals in Google Analytics.


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members