How to get Service Provider back in Google Analytics Universal

Google Analytics removed the Service Provider and Network Domain dimensions on February the 4th, 2020. From off that date they report just '(not set)'.

Through our IP API you can get this information (and more!) back in Google Analytics!

We'll give a few options depending your needs.

This guide is for the previous version of Google Analytics, for our guide for Google Analytics 4 click here.

Lots of traffic? Get the Pro Package so your domain won't get blocked!

Send Service Provider to Google Analytics as an Event:

Just add the following code to your site and you're done. Somewhere in the footer for example. It doesn't need any setup within Google Analytics. Another pro is that you can view the data directly on the home screen in the Google Analytics mobile app. Con is that it's not selectable as a secundary dimension in Google Analytics as easily as if you would send it to a Custom Dimension, check the Custom Dimensions option below on how to set that up.

<script>
//If the following doesn't work anymore your website is probably blocked because of usage, get the Pro Package at extreme-ip-lookup.com
 function getIP1(json) {
   if (json) {
   	EIPL=json;
   }
   if (EIPL.org) {
   	if (typeof ga === 'function' && typeof ga.getAll === 'function') {
		ga(ga.getAll()[0].get('name')+'.send', {
		  hitType: 'event',
		  eventCategory: 'eXTReMe-IP-Lookup.com',
		  eventAction: 'ISP',
		  eventLabel: EIPL.org,
		  nonInteraction: true
		});
	}
	else {
		setTimeout(function() {getIP1();}, 200);
	}
   }
 }
</script>
<script src="//extreme-ip-lookup.com/json/?callback=getIP1&key=demo" async defer></script>
Replace key=demo with your API key: Get your API key.

Send Service Provider to Google Analytics to a Custom Dimension:

This requires setup within Google Analytics. Goto Admin > Property > Custom Definitions > Custom Dimensions and click the red '+ NEW CUSTOM DIMENSION' button. Fill in 'ISP' for example and choose Session as Scope, click Create then on Done. Remember the Index number of this Custom Dimension. Change the 1 in 'dimension1' in the code below with your Index number. Then add it this code somewhere in your footer and you're done!

Important, do not forget: Change the 1 in 'dimension1' in the code below with your Index number.

<script>
//If the following doesn't work anymore your website is probably blocked because of usage, get the Pro Package at extreme-ip-lookup.com
 function getIP2(json) {
   if (json) {
   	EIPL=json;
   }
   if (EIPL.org) {
   	if (typeof ga === 'function' && typeof ga.getAll === 'function') {
		ga(ga.getAll()[0].get('name')+'.send', {
		  hitType: 'event',
		  dimension1: EIPL.org,
		  nonInteraction: true
		});
	}
	else {
		setTimeout(function() {getIP2();}, 200);
	}
   }
 }
</script>
<script src="//extreme-ip-lookup.com/json/?callback=getIP2&key=demo" async defer></script>
Replace key=demo with your API key: Get your API key.

Why stop there, let's make it really interesting:

Also send the ipType value and you'll be able to seperate/filter/segment your visitors by Business, Education and Residential in Google Analytics. Get B2B leads right into Google Analytics, and view them easily in the Google Analytics mobile app on the homescreen!

<script>
//If the following doesn't work anymore your website is probably blocked because of usage, get the Pro Package at extreme-ip-lookup.com
 function getIP3(json) {
   if (json) {
   	EIPL=json;
   }
   if (EIPL.org) {
   	if (typeof ga === 'function' && typeof ga.getAll === 'function') {
		var org=''+EIPL.org;
                if (EIPL.businessName) {
                	org=''+EIPL.businessName;
			if (EIPL.businessWebsite) {
				org+=' - '+EIPL.businessWebsite;
			}
		}
		ga(ga.getAll()[0].get('name')+'.send', {
		  hitType: 'event',
		  eventCategory: 'eXTReMe-IP-Lookup.com',
		  eventAction: EIPL.ipType, // sends Business, Education or Residential as type of visitor
		  eventLabel: org, // sends Service Provider if Residential or the Business/Education name and if available the domain of the Business/Education
		  nonInteraction: true
		});
	}
	else {
		setTimeout(function() {getIP3();}, 200);
	}
   }
 }
</script>
<script src="//extreme-ip-lookup.com/json/?callback=getIP3&key=demo" async defer></script>
Replace key=demo with your API key: Get your API key.

Just send the B2B Leads and not the Residential:

Here we filter on Business and Education visitors, Residential (and hosting) visitors will not get send to Google Analytics. This makes viewing the B2B Leads even easier in the Google Analytics mobile app on the homescreen!

<script>
//If the following doesn't work anymore your website is probably blocked because of usage, get the Pro Package at extreme-ip-lookup.com
function getIP4(json) {
   if (json) {
   	EIPL=json;
   }
   if (EIPL.ipType === 'Business' || EIPL.ipType === 'Education') {
   	if (typeof ga === 'function' && typeof ga.getAll === 'function') {
		var org=''+EIPL.org;
                if (EIPL.businessName) {
                	org=''+EIPL.businessName;
			if (EIPL.businessWebsite) {
				org+=' - '+EIPL.businessWebsite;
			}
		}
		ga(ga.getAll()[0].get('name')+'.send', {
		  hitType: 'event',
		  eventCategory: 'eXTReMe-IP-Lookup.com',
		  eventAction: EIPL.ipType, // sends Business, Education as type of visitor
		  eventLabel: org, // sends the Business/Education name and if available the domain of the Business/Education
		  nonInteraction: true
		});
	}
	else {
		setTimeout(function() {getIP4();}, 200);
	}
   }
 }
</script>
<script src="//extreme-ip-lookup.com/json/?callback=getIP4&key=demo" async defer></script>
Replace key=demo with your API key: Get your API key.

Set this up in Google Tag Manager:

All the options given above are with directly adding code to your pages and or GTM, if you rather do this in a more Google Tag Manager way please read this great and extensive article from 3Whitehats:

https://www.3whitehats.com/knowledge/how-to-get-service-provider-back-in-google-analytics/

Lots of traffic? Get the Pro Package so your domain won't get blocked!