使用 Mixpanel PHP 库设置用户 ip
Setting user ip using Mixpanel PHP library
我正在使用 Mixpanel PHP 库($mixpanel->people->set)设置用户详细信息。工作正常,电子邮件、注册日期等设置正确。
但是位置(国家、城市、Tomezone)属性都是错误的。我相信这可以通过以某种方式设置用户 IP 来解决(因为我们从后端设置 "hit" 并且默认情况下可能会使用我们的服务器 IP)。问题是 Mixpanel API 参考甚至一次都没有提到这个。
如何实现?如何为我的 Mixpanel 用户设置 IP 地址?
谢谢
我刚刚自己找到了答案。
显然参考文献确实提到了它。
Set properties on a user record.
set(string | int $distinct_id, array $props, string | null $ip) If
the profile does not exist, it creates it with these properties. If it
does exist, it sets the properties to these values, overwriting
existing values.
Parameters
$distinct_id stringint the distinct_id or alias of a user
$props array associative array of properties to set on the profile
$ip stringnull the ip address of the client (used for geo-location)
所以用户IP就是set方法的第三个参数
引用自here
我正在使用 Mixpanel PHP 库($mixpanel->people->set)设置用户详细信息。工作正常,电子邮件、注册日期等设置正确。
但是位置(国家、城市、Tomezone)属性都是错误的。我相信这可以通过以某种方式设置用户 IP 来解决(因为我们从后端设置 "hit" 并且默认情况下可能会使用我们的服务器 IP)。问题是 Mixpanel API 参考甚至一次都没有提到这个。
如何实现?如何为我的 Mixpanel 用户设置 IP 地址?
谢谢
我刚刚自己找到了答案。
显然参考文献确实提到了它。
Set properties on a user record.
set(string | int $distinct_id, array $props, string | null $ip) If the profile does not exist, it creates it with these properties. If it does exist, it sets the properties to these values, overwriting existing values.
Parameters
$distinct_id stringint the distinct_id or alias of a user
$props array associative array of properties to set on the profile
$ip stringnull the ip address of the client (used for geo-location)
所以用户IP就是set方法的第三个参数
引用自here