Skip to content

How to pass the ip address to the sdk tracker object #20

@kbgkgould2

Description

@kbgkgould2

Description
Insetting up a call in php I have noticed that the ip address is always the ISP address not the ip address of the browser. How can pass the ip address to the tracker. I thought the call to $_SERVER['REMOTE_ADDR'] would get the correct address.

Example
$config = [
'instance_url' => 'https://owa.mysite.com/',
'cookie_domain' => 'www.mysite.com',
'credentials' => [
'api_key' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXx',
'auth_key' => 'XXXXXXXXXXXXXXXxxxxx'
]
];
$sdk = new OwaSdk\sdk( $config );
$tracker = $sdk->createTracker();
$tracker->setSiteId('XXXXXXXXXXXXXXXXXX');
$pageTitle = isset($title) ? $title : 'My Site' ;
$tracker->setPageTitle($pageTitle);
// where can we pass the ip address of the client, not the ISP?
$tracker->trackPageView();

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions