Use Network Information API and GTM to push your users real connection speed to Google Analytics


Network Information API offers bandwidth and e.g. connection types like 4G

The Network Information interface provides information about the connection a device is using. It offers information about the bandwidth and the type of the connection

In the browser it can be used like this:

var con = navigator.connection || navigator.mozConnection || navigator.webkitConnetion

It returns the effective type of the connection meaning one of ‘slow-2g’, ‘2g’, ‘3g’, or ‘4g’. With


you get the effective bandwidth estimate in megabits per second, rounded to the nearest multiple of 25 kilobits per seconds.

So if you connect this with GTM and run it you get the connection speed of multiple users listed in GA.

Connect with GTM and GA

Go to GTM and create a custom javascript

connect this to to the Google Analytics Tag in GTM as a custom dimention.

The index number needs to be the same as in the definition you do in GA now

Check in Google Analytics

As hinted here the use of Network Information API is limited to some Browsers:

More about this

Google Analytics custom dimensions


Performance Budgets (Keep Request Counts Low And File Sizes Small)

© 2020 Tobias Willmann