It is easy enough to set up a campaign with tracking URLs so that is not discussed here. However, the only thing that get's logged to the campaign_log table is that an event occurred and the date and time. You don't get any information about the user.

That is unfortunate. It leaves you with nothing to work with.

With one simple line you can add the link clicker's IP address.

This works in SugarCRM 6.2.4

  1. Go to the file:[document root]/sugarcrm/modules/Campaigns/utils.php
  2. Open the file and go to line 177 and add the following AFTER that line:
$data['more_information']="'" . $_SERVER['REMOTE_ADDR'] . " [" . $_SERVER['REMOTE_HOST'] . "]" . "'";
Now you will get the user's IP address and might be able to tie that into an analytics system to identify who/what/when.


If you have reverse dns turned off on your webserver for performance the REMOTE_HOST part will be blank. This can be solved by a call to gethostbyaddr() but that can cause serious delays in your CRM with DNS timeouts. If you would like this capability implemented so that you may do IP-TO-ID mapping in such a way that won't cause delays in the CRM please contact me via email to dbeecher at tekops dot com.