cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
4321members
1416posts
InvocaKnowledge
Community Manager
Community Manager

Applies To

Customers may want to keep the Invoca tag from running for specific user IP addresses. 

Resolution

The Invoca tag currently does not have built-in support for capturing a user's IP address as marketing data attribution. To implement this functionality, customers should provide the following information:

 

  • Data Source
    • Customers need to specify a data source the Invoca tag can use to read an IP address. This data source can be a global variable, cookie, or session storage—whichever method the customers prefer to store the IP address and share it with Invoca.
  • List of Blocked IP Addresses
    • Customers should provide a list of IP addresses that they wish to block. These are the IP addresses for which the Invoca tag should not run.

 

By utilizing this information, custom code in the tag can be implemented to read the IP address from the specified data source and check if it is present in the list of blocked IP addresses. If the IP address matches one of the blocked addresses, the code can be set to prevent the Invoca tag from running accordingly.
 

// customers should provide the list for blocking and can maintain the list for future maintenance purposes.
var IP_BLOCK_LIST = ['ip1', 'ip2'];

// customer should provide the data source to read a user's IP address. In this example, it reads from the window object.
var userIp = window.ipAddress;

Invoca.Client.isUserBlockList = function () {
return IP_BLOCK_LIST.includes(userIp)
}

// set autoRun as true if a user is not a block list.
options.autoRun = !Invoca.Client.isUserBlockList()

 

 

Need more help?

Don't see what you are looking for? You can ask the Community or contact support.