Adsmurai-Google-Tag-Manager-Templates / adsmurai-facebook-pixel-and-conversions-api

Google Tag Manager template that fires Facebook, TikTok & Pinterest events through regular pixel and Conversions API.
Apache License 2.0
23 stars 8 forks source link

Change IPv4 addresses for Lead events to IPv6 #14

Closed fikiismyname closed 7 months ago

fikiismyname commented 9 months ago

Issue Description

I would like to request a change regarding IPv4 addresses for Lead events to IPv6 for the following reasons:

IPv6 is preferable over IPv4 for IPv6-enabled users, and it has become the industry-accepted standard. This change would offer durability for our integration.

Expected Behavior

The expected behavior is to update the Lead event addresses from IPv4 to IPv6.

Current Behavior

Currently, our Lead events are using IPv4 addresses.

Additional Context

This change aligns with industry standards and offers improved support for IPv6-enabled users.

Priority

High

Labels

mjadsmurai commented 8 months ago

HI @fikiismyname apologies for late reply, i did not receive any notification of an issue being created. Regarding your request: We do not choose/have any preference on having IPv4 over IPv6, we simply try to grab the IP that we receive in the following order:

X-Client-IP
X-Forwarded-For (Header may return multiple IP addresses in the format: "client IP, proxy 1 IP, proxy 2 IP", so we take the first one.)
CF-Connecting-IP (Cloudflare)
Fastly-Client-Ip (Fastly CDN and Firebase hosting header when forwared to a cloud function)
True-Client-Ip (Akamai and Cloudflare)
X-Real-IP (Nginx proxy/FastCGI)
X-Cluster-Client-IP (Rackspace LB, Riverbed Stingray)
X-Forwarded, Forwarded-For and Forwarded (Variations of #2)
appengine-user-ip (Google App Engine)
req.connection.remoteAddress
req.socket.remoteAddress
req.connection.socket.remoteAddress
req.info.remoteAddress
Cf-Pseudo-IPv4 (Cloudflare fallback)
request.raw (Fastify)

So it will be v6 or v4 depending on the client. Most clients don't have IPv6 as internet providers do some "hacks" like CG-NAT to keep using their infra with v4 rather than upgrading it :(