This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 3
Track Which Website User Came From?
Started 9 years ago by grossbusterscc | 6 posts |
-
I would like to embed the same form on multiple websites and it would be great if I could track which site the user filled out the form at.
I currently have multiple versions of the same exact form; one for each site. When a user fills one out, I know which site they came from because I set the subject line for the email I receive upon submission as the domain with that particular form. This method works, but is a massive pain whenever we need to make changes to the forms- we have to change each one individually.
Any suggestions?
Thanks!!
-Robert
Posted 9 years ago # -
Hi,
The easy way, you can put a single line text field into your form and parse parent domain url information through url variable.
You can use iframe embed code for this and put the url variable like this on your form url :<iframe src=".../embed.php?id=1234&element_id=http://site1.com" ..
In there I assume single line text field id is 1 and then you can hide that single line text id from the user using css code.
For further information, you can see these link :http://www.appnitro.com/doc-url-parameters
MachForm Support
Posted 9 years ago # -
This works like a charm, thank you so much!
Posted 9 years ago # -
To take this one step further, does anyone know if there is a line of code that can be used to 'automatically' or 'dynamically' add the URL the form is embedded on into the hidden text field? This would be especially useful for a large website with many pages which has a machform embedded on each page. It would be nice to be able to see exactly which page the user came from WITHOUT having to change the url in the embed code to match each individual page of the website. i.e. http://www.example.com/page1 , http://www.example.com/page2 etc.
Thank you in advance!
-Robert
Posted 9 years ago # -
Couldn't you assign the page URL to a variable and then use that variable in the embed code?
<?php
$Get_url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URl'];
?>var __machform_url = 'http://www.domain.com/form/embed.php?id=12345&element_id=<?echo $Get_url?>
Posted 9 years ago # -
Thank you, frankzobitz for your response! I guess I'm in a little over my head, I don't really know how to work with PHP.
...anyone want to explain the steps on how to implement this? =)
Thanks!
Posted 9 years ago #
Reply
You must log in to post.