DTM - How to use Client IP address as a rule condition

Avatar

Avatar

stewart_schilli

Avatar

stewart_schilli

stewart_schilli

15-10-2015

I'd like to know how to use the client's IP address as a rule condition in DTM.  I'd like to be able to include or exclude based on IP address using regular expressions for matching.  Is there a clean way to do this? 

 

Thanks, 

-Stew

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

shawncreed1

Avatar

shawncreed1

shawncreed1

15-10-2015

Stew,

Unfortunately IP address is not exposed directly in the browser via HTML/Javascript for security reasons. The only way that DTM could use IP address is if your site actually set the user's IP address in a Javascript variable on every page, or if you used an AJAX call to an outside server to get this information.  The latter of these is not the preferred option given that it adds additional latency to the processing of your DTM rules (because it has to wait for the remote server to respond), but on the plus side it is something that you would be able to implement and try out without involving your IT department to update the code on the page.

Here's a link to check out with some ideas on how this might be done (note that this is an external site so none of the code has been vetted/tested by Adobe):
http://stackoverflow.com/questions/391979/get-client-ip-using-just-javascript

Hope this helps!

Best,
Shawn

Answers (0)