Get User IP Address With Google Tag Manager

Standard

Visitor IP Address with Google Tag Manager pass into Google Analytic

Recently one of client ask to get visitor IP Address using Google Tag Manager Also other details like City, Country , Longitude, latitude, Region Code, Region Name , Timezone, Currency Code and Currency Symbol etc,

Challenging here without Geo location API, you can not tracking these above details, either you need to buy a paid geo location API or free geo location API. Process involved in tracking Geo location API convert in Data layer to pass those information City, Country , Longitude, latitude, Region Code, Region Name , Timezone, Currency Code and Currency Symbol etc

First Install Google Tag Manager on the website and To get visitor IP Address with Google Tag Manager

Paste this code as high in the <head> of the page as possible:
<!– Google Tag Manager –>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({‘gtm.start’:
new Date().getTime(),event:’gtm.js’});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!=’dataLayer’?’&l=’+l:”;j.async=true;j.src=
‘https://www.googletagmanager.com/gtm.js?id=’+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,’script’,’dataLayer’,’GTM-XXXX’);</script>
<!– End Google Tag Manager –>
Additionally, paste this code immediately after the opening <body> tag:
<!– Google Tag Manager (noscript) –>
<noscript><iframe src=”https://www.googletagmanager.com/ns.html?id=GTM-XXXX”
height=”0″ width=”0″ style=”display:none;visibility:hidden”></iframe></noscript>
<!– End Google Tag Manager (noscript) –>

Note:  Make you will replace GTM Tracking Code with your GTM ID XXXXX

It’s time to verify result with Google Tag Manager to Get Visitor Details like Website IP Address,  City, Country , Longitude, latitude, Region Code, Region Name , Timezone, Currency Code and Currency Symbol etc,

Fetch IP Geolocation Data Using Google Tag Manager

Get an IP address using Google Tag Manager to See Visitor IP Address

Get a Visitor's IP Address in Google Analytics

Get IP address to the Google Tag Manager

Warning: If you do n’t know about javascript or do n’t have developing knowledge then do n’t try to Visitor IP Address using Google Tag Manager that can broke your site, Cart and other functionality 

Disclaimer: Google tag manager belongs to Google property 

For Contact: mappchero@gmail.com

I am available for Hire on Freelancer: Freelancer.com

I am available for Hire on Upwork: Upwork.com

I am available for Hire on Peopleperhour: Peopleperhour.com

I am available for Hire on Guru: Guru.com

Leave a Reply

Your email address will not be published. Required fields are marked *