title: Server Side Google Analytics Client IP
body: <p>I'm using the following:</p>
  
  <ul>
  <li><a href="https://wordpress.org/support/plugin/seriously-simple-podcasting" rel="nofollow">https://wordpress.org/support/plugin/seriously-simple-podcasting</a></li>
  <li><a href="https://github.com/dancameron/server-side-google-analytics" rel="nofollow">https://github.com/dancameron/server-side-google-analytics</a></li>
  </ul>
  
  <p>I'm using wordpress action hooks that the plugin provides to use the ss-ga class that triggers a page hit for the XML Feed (iTunes needs this) and event for the podcast play (download):</p>
  
  <p><code>ssp_file_download</code> and <code>ssp_before_feed</code> </p>
  
  <p>That all works great.  I'm using cloudflare, so I can use <code>$_SERVER['REMOTE_ADDR']</code> OR <code>$_SERVER["HTTP_CF_CONNECTING_IP"]</code> to get the client IP. The problem, is that with ss-ga, I cannot send the client IP when registering the event or page hit.  As a result, it always shows Chicago, which is where my host's data center is.</p>
  
  <p>Can someone suggest a way to make sure that when I send an analytics event using a php class, that the IP is correct?</p>
  
  <p>Thanks in advance.  If you want any code, just let me know but I've used basic examples as provided by both script's documentation. </p>
  
  <p>Cheers.</p>