How to track IP addresses accessing the Website using Google Analytics

Many people running Google Ads encounter click fraud and fake clicks from competitors, causing their advertising budget to be depleted quickly in a short time. You want to collect IP addresses from these clicks to eliminate these bad IPs. Or you want to know the origin of visitors from the IP address that clicks on your website. Tracking IP addresses accessing the Website using Google Analytics is an effective method to help you achieve that goal. Please stop at this article by Optimal Agency to get more useful information on this issue!

☑️ Qualitiy account 💯, no worries about getting lock☑️ Immediate use, unlimited spending 
☑️ Best rental price☑️ Create campaign freely
☑️ Many offers☑️ Optimized ads campaigns
☑️ Consulting fast approved ads☑️ Safe, secure, effective and affordable
☑️ Diverse services, accounts☑️ 24/7 technical support

Why do you need to track IP addresses accessing the Website?

Many businesses when running Google ads may encounter situations where competitors play dirty tricks such as spamming ads, clicking multiple times on ads, and wasting budget. The business’s staff accesses the website to check and review errors that lead to increased visits but are not counted as visits from customers. In case advertisers need to check and classify the IP addresses accessing the website in time.

By tracking the IP addresses accessing the website using Google Analytics, businesses can know whether the IPs accessing the website are valid or not. At the same time, evaluate the situation and determine the cause of the increased traffic. From there, take appropriate measures to ban IPs or create IP filters for inappropriate objects.

Tracking the IP addresses accessing the website helps businesses better understand their customers to support the process of implementing marketing strategies and managing the website. This tool provides important information about the demographic characteristics and behavior of visitors to optimize the user experience on the website. Through tracking IP addresses, businesses can optimize marketing strategies, improve advertising performance as well as optimize content suitable for each specific object.

Through the process of checking and tracking IP addresses accessing the website, businesses can identify and prevent fraudulent or threatening behaviors to the security of the website while ensuring the safety of user data and information. IP addresses provide data to create personalized experiences that help businesses create appropriate content. Based on the collected IP addresses, businesses can evaluate the performance of advertising campaigns. In addition, determine cost-effectiveness and adjust strategies accordingly.

Readers should learn more about other related information such as Google Ads extensions.

Instructions for tracking IP addresses accessing the Website using Google Analytics

Once you understand the benefits of tracking IP addresses, follow the tracking steps as instructed below. However, first, you need a Google Analytics account and a Google Tag Manager account. After having an account, you can start with the following steps:

Instructions for tracking IP addresses accessing the Website using Google Analytics

Step 1: Collect IP addresses of website visitors

If you want to collect IP addresses from people who have visited your website, use the JavaScript code and integrate it into the Tag section in Google Tag Manager. To do this, log in to your Google Tag Manager account. Then select the Tag item in the left column in the Default Workspace interface.

Next, select New to add a new tag. Then configure the tag with custom HTML by clicking on the pen icon. Now, paste the following JavaScript code into the custom HTML tag to collect the user’s IP address as follows:

The meaning of this code is to pull the visitor’s IP address through the ipify.org API to get a free IP address. Then transfer this address to the dalalayer for Google Tag Manager to read.

Step 2: Install Trigger

After adding the JavaScript code to the Tag section, the visitor’s IP address will be sent to the website via the ipify.org API via APT and then sent to the datalayer for Google Tag Manager to read. To avoid collecting the IP address multiple times and sending continuous ipify API queries, you need to set up a Trigger to collect the IP address only once.

Go to Google Analytics and click on Trigger. Then click on the pencil icon and click on Pageviews. A trigger is an event that triggers Google Analytics to collect data. You can choose to trigger as All Page Views to have the tag fired on all pages of your website or app.

If you only want the tag to be triggered on certain pages, select Some page views with custom conditions. In the Criteria section, select Some page views and enter the number of page views you want Google Analytics to collect data for. Then fill in the custom information and domain name of your website. Then go back to the Trigger and click Submit and select Publish.

Step 3: Create Variable

A variable is a variable that contains the data you want Google Analytics to collect. In the third step of tracking IP addresses accessing the Website using Google Analytics, you need to create a Variable that contains the IP address of the visitor. To do that, go to Google Analytics, click on Variables, then create a new variable and name it Ip Address. If you have already created a variable but want that variable to track the website IP, you can edit it by clicking on the pencil icon to customize the variable and select Data Layer Variable. In the Data Layer Variable Name box, enter ipAddress and the required information.

Step 4: Drag IP to Google Analytics

In this step, you need to create a Universal Analytics tag to bring IP data to Google Analytics. In the Trigger, select New, click the pencil icon, and select Custom Event. Then in the Event Name box, enter ipEvent and move on to the next step.

Step 5: Display IP in Google Analytics

If steps 1 to 4 are intended to collect IP data of users accessing the website. To retrieve data to Google Analytics for easy viewing, you need to create a Custom Dimension to see which IPs are viewed on that landing page. To do this, go to the Google Analytics homepage and click the gear icon in the Settings section. In the left column, select Custom Dimension and enter your IP Address in the Name box. A table of Custom Dimension names will then be displayed. In particular, pay special attention to the dimension with an index of 1.

Step 6: Add Universal Analytics tag

This Universal Analytics tag will have the function of connecting their data. To complete the tracking of IP addresses accessing the website, you need to create a Universal Analytics tag so that the Trigger in step 4 can return the IP that can be viewed in Google Analytics. In Google Tag Manager, select Tags, then select New and click the Pencil icon. Then select Google Analytics – Universal Analytics, then select the Enable override settings box in this tag, right below is the Tracking ID box.

You can get the ID by going to Tracking Information in the left column, then selecting Tracking Code and copying it into the Tracking ID section. When entering the tracking ID, select Other Settings, then select Custom Dimensions and fill in the correct custom dimension with index 1. The information you need to care about is that the dimension value must be {{ip Address}} as in step 3 and connect this Tag to the ipEvent Trigger that was activated in step 4. After doing so, click the Submit button and select Publish and you’re done.

Step 7: Check the settings again

Finally, you need to check whether the process of tracking IP addresses accessing the website is successful or not. By accessing the Behavior section, selecting All pages, then selecting the date and going to the link you need to view, select the Secondary Dimension: ipAddress. At this point, you can get all the IP addresses of users accessing your website. After installation, you need to wait for new users to access the page to get the IP address.

With just a few simple steps, you can quickly track IP addresses accessing the Website with Google Analytics. With the detailed instructions we have shared above, you can successfully know the origin of visitors to deploy effective advertising campaigns.

Please see more:

Frequently Asked Questions

Why can’t I collect website visitor IP addresses using Google Analytics?


This happens because some users may use VPNs to hide their IP addresses. Then Google Analytics will not be able to collect their exact IP addresses. Moreover, tracking and collecting IP addresses is only effective for visits after you have installed tracking. Websites with low traffic will take longer to aggregate IP addresses.

What tools can track and report website IP addresses?


If you want to collect and store IP address data, you can use some tools such as landing page tools, Google Analytics, CRM, user analysis tools (Kissmetrics, Mixpanel), web storage tools, and logs. Depending on your needs and purposes, choose the most suitable tool.

Detailed and simple instructions on tracking IP addresses accessing websites using Google Analytics to help increase advertising effectiveness.

5/5 - (1 vote)

Optimal Agency

Optimal Agency is a business established in Vietnam. With deep knowledge of the advertising market, customer behavior and a diverse portfolio of resources, we aim to provide you with high-quality digital marketing services.

Product

Copyright: © 2023 Optimal WordPress theme by Optimal Agency. All Rights Reserved.