Page 1 of 1
IP Tracking Code
Posted:
April 25th, 2011, 12:53 am
by fcp2011
Can admin explain how the following code works?:
This example uses cv1 to track a User's IP address:
( The IP address could be referenced using %%cv1%% )
custom="www.freeclassifiedproducts.com|<?php echo $_SERVER["REMOTE_ADDR"]; ?>"
I am trying to use gravity forms user registration plugin as my registration method. I use iDev to track sign ups via the 3rd party call. Gravity forms plugin does work with s2member but I need to pass the ip address.
Just trying to see if I can use the above code to do so.
Thanks,
Daniel
Re: IP Tracking Code
Posted:
April 25th, 2011, 1:01 am
by fcp2011
And if possible, tell me how this code works with the paypal pro form. If I can add this in to the gravity forms in the same place, that would rock.
Thanks again.
Re: IP Tracking Code
Posted:
April 25th, 2011, 1:46 am
by Cristián Lávaque
Hi Daniel.
I don't understand what you're trying to do very well.
You want to use Gravity Forms for your registration page and then track that registration with iDev, so you need Gravity Forms to pass the IP data to the tracking API, is that it?
Re: IP Tracking Code
Posted:
April 25th, 2011, 8:01 am
by fcp2011
for iDev to work the way I use it, the ip address has to be used. s2Member already has this built in via the cv1 variable. I was trying to find more about how this code worked and when it pings the user's computer.
Re: IP Tracking Code
Posted:
April 26th, 2011, 8:02 pm
by Cristián Lávaque
Got it. OK, then add something like this in your form:
- Code: Select all
<input type="hidden" name="custom" value="<?php echo $_SERVER['HTTP_HOST'], '|', $_SERVER['REMOTE_ADDR']; ?>" />
Re: IP Tracking Code
Posted:
April 26th, 2011, 10:03 pm
by fcp2011
So, are you saying that I can use any form I want, as long as the one I use has a field named "custom" which contains the member's ip address?
Or, do I need to write some php code (more like have someone else write) that passes the client's ip address to a particular variable that s2member uses.
Re: IP Tracking Code
Posted:
April 26th, 2011, 10:32 pm
by Cristián Lávaque
I don't know if any form, but I'm telling you how you could try passing the custom values: the domain name and the person's IP.
Re: IP Tracking Code
Posted:
April 26th, 2011, 10:57 pm
by fcp2011
And where or what variable am I passing them to? Is it a s2Member thing or a wordpress thing that I am passing this info to?
Re: IP Tracking Code
Posted:
April 27th, 2011, 5:20 pm
by fcp2011
Ok, question here:
When I add the code above to my form, does it insert the url and ip address when the user hits the "submit" button or when the form is loaded during page load to the user's browser window?
Re: IP Tracking Code
Posted:
April 27th, 2011, 5:40 pm
by Cristián Lávaque
It'll use the values of those variables when it creates the form, which will then be submitted with it. This custom field will let s2Member have the IP address in cv1 when you use the Tracking API for iDev integration.
Re: IP Tracking Code
Posted:
April 28th, 2011, 4:21 pm
by fcp2011
Is this data added to the wordpress member table for that user? Can I just insert that data into the variable cv and cv1 when the page loads (vice when the form is submitted) in preperation for the user's registration?
Re: IP Tracking Code
Posted:
April 28th, 2011, 4:50 pm
by Cristián Lávaque
I'm not sure it stores in the the usermeta.
Have you run some tests to see if you can do what you want? You'll get more familiar with it and have a better understanding.