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?


  1. grossbusterscc
    Member

    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 8 years ago #
  2. redityo

    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 8 years ago #
  3. grossbusterscc
    Member

    This works like a charm, thank you so much!

    Posted 8 years ago #
  4. grossbusterscc
    Member

    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 8 years ago #
  5. frankzobitz
    Member

    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 8 years ago #
  6. grossbusterscc
    Member

    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 8 years ago #

RSS feed for this topic

Reply