0

I've seen in Magento 2 documentation, it should show IP of "Now Online" customers. However I cannot find any setting related to enable this from admin, and there is no filter option for IP.

Is there a way to show IP of customer who are currently online in website ?

1

Magento 2 native doesn't have feature to show customer IP who is online. There is other way, you have to create one module for display ip in back-end online customer grid. In that module create one di.xml file and use customer login event for get and save customer ip in 'customer_visitor' table. Create one column in customer online grid at back-end and display this ip from 'customer_visitor' table. You can get IP via below code.

$om = \Magento\Framework\App\ObjectManager::getInstance();
$obj = $om->get('Magento\Framework\HTTP\PhpEnvironment\RemoteAddress');
$ip =  $obj->getRemoteAddress();

I hope this will help you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.