[UA] Latency and why it impacts Google Ads Clicks and Analytics Sessions [Legacy]

You are viewing a legacy article about Universal Analytics. Learn more about Google Analytics 4 replacing Universal Analytics.

If, after reading the above articles, you still have a clicks-sessions discrepancy that is difficult to explain, latency may be responsible. Typically, clicks-and-sessions issues where latency is a factor have the following attributes:

  • The clicks-sessions discrepancy cannot be narrowed to a specific Campaign, AdGroup or Keyword
  • Across all active Google Ads campaigns you see a consistent undercounting of Sessions compared with Clicks.
  • Segmenting by device eg: Desktop, Tablet, Mobile shows a discrepancy that persists across multiple platforms.
In this article:

Why it's important to be fast

As a general rule, users on the internet are not very patient. This is evident from studies such as the KissMetrics study that elicited some sobering statements like: "A one-second delay in page response can result in a 7% reduction in conversions." along with "47% of consumers expect a web page to load in two seconds or less."

What does this mean for you? If your website loads too slowly, then there is a possibility that users are leaving and going to your competitors, especially if competitors are able to deliver the same content quickly.

Position is important

We often get asked where the Analytics tracking code should be placed in the HTML source of a page. The answer is, it depends on how accurately you want to measure users who bounce. If a click takes place and it takes several seconds for a session to be recorded, then there is a strong possibility that some of these sessions may not get tracked. In general, we recommend placing the tracking code just before the closing </head> tag.

Consequences of slowness

Short Clicks: A short click occurs when a user clicks an ad, and then before the Analytics tracking-code request is fired, the users clicks the back button or closes the browser. Google Ads records the click, but a corresponding session is not recorded in Analytics.

Generally speaking, the slower the website is to respond and the larger the number of requests that appear before the Analytics snippet, the more likely it is you will be subjected to issues with short clicks and missing session data.

Another way to think of short clicks is that they are actually users who are bouncing from the website, which means if you are not tracking these bouncing sessions, then your bounce rate could be artificially low.

Mobile and Short Clicks: As a general rule, mobile devices operate on slower network infrastructure (3G networks) than most Desktop connections (ADSL / Cable). If you target mobile devices, a fast-responding website is even more critical to preventing short clicks.

A short-term solution to short clicks

A short-term solution is to try to place the Analytics tracking snippet as high up in the HTML source as possible. Ideally above any other javascript files.

In the screenshot above you can see that there are several JavaScript file requests that must take place (synchronous tags) before the Analytics tracking snippet can run. We will discuss optimization techniques later, but for now, a short-term solution would be to move the Analytics tracking snippet above the other javascript files. Don’t worry, though: Analytics won’t slow down your page-render times because it’s an asynchronous JavaScript tag, which means it won’t prevent your page from rendering even if there is a delay from the Analytics server.

The reason this is a temporary solution is that it may help you record sessions that were otherwise missing due to users leaving your page early (since the Analytics snippet is not executed earlier). In the long term, however, you want to retain those users who bounce and fix the underlying issue, which is a slow-responding website.

How do I know if it's slow?

As mentioned above, placing the Analytics tracking code higher in the HTML source will help to a certain point, but a faster responding website is also important.

So how can you tell if your website is slow?

Test 1

With an empty cache (clear cache and cookies if you like), open a new tab, enter your destination URL in the browser address bar, and open Chrome developer tools to the network tab.

Load the website and watch the request list. It should look something like this:

Look for _utm.gif (classic Analytics) or collect (Universal Analytics), and observe the timeline section to the right hand side. In the illustration above, you can see that it took about 8 seconds from the time the first request was made (where a click would be recorded) to the Analytics request (where a session would be recorded).

If a user clicks the back button within these 8 seconds, Analytics may fail to record a session on this website, but Google Ads will have recorded the click.

Remember the KissMetrics quote: "Half of all users expect a page to load in two seconds or less." This website could improve!

Test 2

Analytics automatically captures page load time data automatically as part of the Site Speed reports.

This report allows you to focus on specific Google Ads Destination URLs to see how they perform in terms of latency. In this particular example, we see site speed is around 25 seconds for this specific URL, which is really slow.

Notice how the bounce rate for this page is also high? So even though this Destination URL already leads to short clicks (i.e., bounces), those that are recorded have a high bounce rate also, which is not good.

Ideally page load speed should be around 3-4 seconds.

Although these Site Speed reports are a good indication of page-load times, by default the sample is based on only 1% of traffic. If you have a relatively small number of daily users to your site, such as 100,000 or fewer, you might want to adjust the sampling to a larger rate, e.g., 5%. This will provide increased granularity for page-load time and other Site Speed metrics.

Keep in mind that this creates an additional request, and in almost all cases shouldn’t negatively impact the user experience.

How can I make it faster?

Analytics Site Speed reports now provide site speed suggestions. Enter your most-clicked Destination URLs to see suggestions on how to make those pages faster.

Remove redirects or update Destination URLs

Even if your redirects preserve the Google Ads auto-tagging parameter and pass it to the final Destination URL, redirects add additional latency between the click and the time the session can be recorded by Analytics.

In some cases, site owners have multiple redirects between the Google Ads click and the final Destination URL.

You should update your Google Ads Destination URL to reflect the final Destination URL so that no redirects need to take place.

In some cases, clients use an intermediary service like a click server to record the Google Ads click, often used by third-party reporting platforms.

While we understand that you want to report in multiple platforms, this service could act as a bottleneck and slow down the user experience. If you are experiencing difficulties with clicks and sessions recorded in Analytics, then we recommend that you try removing this click tracker service for a limited time to see if the ratio of clicks to sessions improves, and then reevaluating whether you want to continue tracking in the third-party platform, or alternatively look for a provider that is faster.

CSS sprites

CSS sprites can replace multiple image requests.

Notice how the website in the illustration above has multiple image requests (.png files) to small image icons and files. The advantage of CSS sprites is simple: instead of having multiple image requests, place all these images into a single request (one larger image) and use CSS to control which parts of the image are displayed in certain areas of the website. One large image request is faster than multiple small image requests.

Use a CDN (Content Delivery Network)

A content-delivery network is a great way to speed up your website while also making it more scalable and reliable. It works by distributing the commonly accessed files and content from your website and placing them on multiple servers around the globe.

Normally, a web-hosting service is located in a fixed physical location, for example, California. This is fine for users in California as they will receive content from your website quickly, but what about users in Australia or Europe? They will experience more latency waiting for files from California, but by using a CDN, those users can receive files from a server closer to their physical locations.

By distributing your website across multiple servers around the world you are also less impacted by outages or other infrastructure problems.

A CDN is great for content that generally remains static or doesn’t frequently change, such as your JavaScript files, CSS, HTML and images or video content. It will also take care of compressing these files to the smallest-possible size by removing line spacing in JavaScript, CSS and HTML files.

Google Offers its own CDN service called Google PageSpeed.

Compress HTML, CSS, and JS files

If you don’t want to use a CDN service (mentioned above), you can still find various modules, plugins and free web services that automatically compress content for you by removing line spacing and bundling multiple files (e.g., CSS files) into a single request.

Cache popular requests

A popular web-server stack uses Linux Apache MySQL PHP (LAMP).

In the diagram above, we can see that there are actually several steps involved in returning an HTML-rendered page to the user:

  • The web server receives the request
  • The web server then sends the request through PHP, which decides which files or database rows to access
  • PHP packages this up and builds the relevant HTML page which is then returned to a user

How caching can help

In many cases, the content of your pages doesn’t change each time a user requests the page, e.g., an FAQ page. Rather than going through the whole process in the diagram above, we can build the page once and cache it as a temporary HTML file. This saves the web server from having to repeat the same task of generating a page via PHP and querying a database over and over, and instead lets it serve a static HTML file to most users. This can free the web server from constant multitasking, and speed up your website for everyone.

There are several free modules available that perform this task for your website.

Although PHP was the example given above, many other web servers work on a similar principle and will likely have similar modules available to accomplish this form of page caching.

Consider using ajax, and plugins like Infinite Scroll or Lazy Load for Jquery

Have you ever noticed that some websites load content as you scroll down the page? YouTube does this for thumbnails of related videos, and the comments section is limited to the first few results unless you request additional comments to be displayed.

Appropriately using such techniques can reduce the initial page-size request and allow users to start interacting with your pages immediately. Should they wish to see more content, they can scroll further, triggering additional items to be loaded.

There are several usability and accessibility issues to keep in mind when implementing this form of solution. See to LazyLoad and InfiniteScroll documentation for more on this.

Gzip compression

Older web browsers didn’t support this form of page compression (HTML, CSS, JavaScript etc.), but newer browsers, including mobile devices, do. The best part of this feature is that it’s often a simple flip of a switch to take advantage of it.

You can learn more about Gzip in this video.

Upgrade to Universal Analytics

If you haven’t already upgraded to Universal Analytics (analytics.js) from Classic (ga.js), you may want to try migrating to the newest Analytics platform. Not only will you get access to the latest product features, but Universal Analytics has a couple of performance improvements worth noting:

  • Module-based tracking-code library: analytics.js, has external modules like Ecommerce that are no longer included for all websites (which is how ga.js works). This reduces the analytics.js footprint in terms of filesize, which equates to a faster file transfer speed.
  • Reduced dependence on cookies: Universal Analytics now calculates campaign and session data server side (as opposed to client side), reducing the amount of cookie data transferred for every file request. This can offer a small but noticeable performance boost.

Faster web hosting server

You may be losing business due to a slow website. It's worth considering an upgrade to a faster web hosting server.

Further tips and suggestions

This article can’t cover all optimization techniques available, but we can certainly point you towards many more. Refer to this documentation for additional tips and suggestions.

Finally, keep in mind that you may be able to improve the speed and responsiveness of your own website, but at some point you may run into issues with users' slow internet connections and slow mobile networks. This is more of a problem in remote and rural areas, and in developing countries with limited or old telco infrastructure.

The best you can do in such circumstances is make your website as responsive as possible, but even the most well optimized website may suffer from short-clicks due to slow user connections.

Was this helpful?

How can we improve it?
true
Choose your own learning path

Check out google.com/analytics/learn, a new resource to help you get the most out of Google Analytics 4. The new website includes videos, articles, and guided flows, and provides links to the Google Analytics Discord, Blog, YouTube channel, and GitHub repository.

Start learning today!

Search
Clear search
Close search
Google apps
Main menu