Eloqua - How to pass landing page name using same form during submission

Farrell Posts: 25 Green Ribbon
edited Apr 29, 2022 6:29AM in Eloqua

Hi experts,

I have a common form (ContactMe_Form) that is being used in multiple landing pages. However, from the "Form Submission" report, I could not identify which landing page is the data submitted from.

Is there any way to pass the name of the Landing Page as a hidden field into the form during submission and store it somewhere? I did a simple diagram to illustrate this.

Appreciate your kind advice please. Thank you.

Post edited by OIT Integration User on


  • Codrin Teiu
    Codrin Teiu Iasi, RomaniaPosts: 62 Gold Medal
    edited Feb 18, 2021 12:42PM

    Hi @Farrell ,

    Create a hidden text field in the form, for example "source".

    In the pages that host the form, go in the code and add it with a set value with the LP name. Obviously in each page's code you would put its corresponding name.

    Codrin/Logarithmic Solutions

    Post edited by Codrin Teiu on
  • Farrell
    Farrell Posts: 25 Green Ribbon

    Hi @Teiu Codrin ,

    Thank you for your reply. Is it possible to add in the html code if the LP is created using Eloqua designer? I'm trying NOT to convert to HTML codes.

    Do I also need to set an Query String as per mentioned in the below document? Seems very complicated as it requires Query String + Javascript with customs URL string.

    How to Capture Referring Sources to Landing Pages And In Forms Using Query Strings ( Doc ID 1644812.1 )

    Thank you.

  • Codrin Teiu
    Codrin Teiu Iasi, RomaniaPosts: 62 Gold Medal

    @Farrell i think that's the best guide if you want to stick to the editors.

    If you were able to edit code in the LP html code it would have been easy to set a form field to hidden and just pass on a static value with the LP name.

  • HongTai
    HongTai Posts: 44 Bronze Medal

    Hi @Farrell !

    There's actually a pretty quick way to manage this - by simply creating a field merge that merges from a query string.

    Place that field merge onto your form in an ELQ landing page, and you should be good to go.

    Here's the link for the documentation, but if there's any other questions, please feel free to reach out!

    Best Regards,

    Hong Tai Lee

    [email protected]

  • Farrell
    Farrell Posts: 25 Green Ribbon

    Hi @HongTai ,

    Thank you very much for the quick way.. this is much easier than the guide  ( Doc ID 1644812.1 )

    However, don't mind if I ask a few clarifications:

    1. Do I still need to create Query String using "Assets > Website Setup > Query Strings"
    2. In your guide referred, there's this part on "encodeFor=url" that needs to be enter within <span> tag. Must I use the exact same text "_469_numeric1" in the example or I can just leave the <span> tag blank?
    3. How can I do this within an email reference by a CTA button because it seems like after selecting the Landing Page from the [Hyperlink Properties] section within the Eloqua email, it will append all the elqTrackId query string automatically and doesn't allow any editing. If I change to "Webpage" and enter the URL manually, then I'll loose all the default query string.

  • HongTai
    HongTai Posts: 44 Bronze Medal

    Hello @Farrell !

    Glad to be able to have found a quicker shortcut for you! Questions are always welcome since it just gets us closer to the right answer!

    Looking at your questions:

    1 - Unless you actually want to run a query string report, and this also runs on cookie tracking (not the same as a form submit) - then maybe? Otherwise, for the situation where you want to know the source for each submission, there's no need.

    2 - There's not too much of a need to add that in, since that's a lot more useful for cases like field merges that build up into a real URL and etc. For now ... the source isn't much of an address is it? Even if it is, you don't need it entirely URL encoded since you just want to focus on the source / not access the source directly from the submitted value

    3 - For this case, it's a little bit "delicate", since once you set it, you don't want to go back in and edit since the auto-edits makes things a tad confusing. Otherwise, take the landing page vanity URL that you have, type in the query string, paste it in, and "do not go back into it again". If you do, I think it would overwrite it, and if that's the case, put in the "&" at the end of it and re-enter the query string. Let me verify it though again.

    Also, not a problem at all with the timezone, I'm fortunate enough to work with some Australia / JPN teams as well - just always happy to help!

    Best Regards,

    Hong Tai Lee

    [email protected]

  • Sainathk
    Sainathk Posts: 9 Red Ribbon
    edited Feb 23, 2021 7:48PM

    Create a hidden field in the form.

    Add the below script under the Additional javascript section in the design editor. Replace "fe29527" with the hidden field id of your form.

    </script><script type="text/javascript"> > document.getElementById("fe29527").value = "Landingpage1"</script>

    how to check the hidden field id.

    open the landing page in the browser, right-click and view page source- search for the "hidden field"

  • HongTai
    HongTai Posts: 44 Bronze Medal
    edited Feb 23, 2021 7:54PM

    If that's the case - from an "easy user" stand point, it'll be simpler to create 3 separate forms for each landing page with a static value in a hidden field, that way if they do need to update anything, they wouldn't need to hunt for the code. In addition, the script code should likely execute on a windows.onload to ensure the fields loaded before this script runs to inject the value.

    Was approaching this from a hub point of view, but definitely using scripts would make anybody who lands on the page track the source (eg. google / URL without query string passover).

    Then really, have these 3 forms update one CDO set and treat the CDO set as the "hub master" as well with the added benefit of being able to change the processing steps on each "source".

    Just in case though, may have read between the lines - is the "campaign" / story source more important or strictly the "page destination"?

  • Farrell
    Farrell Posts: 25 Green Ribbon

    @Sainathk ,

    Thanks for the codes but it doesn't seems to work when I enter the script within "Code and Tracking -> Additional Javascript" section of Eloqua Landing Page designer. My codes are as follow:

    document.getElementById("fe2471").value = "Test-Campaign";

    document.getElementById("fe2472").value = "Test-Medium-Email";

    document.getElementById("fe2473").value = "Test-Source-Eloqua";


    I did not include <script> because Eloqua mentioned is not needed. I've also added "alert" just to ensure this piece of code is executed. However, when I open the Landing Page in browser, this prompt did NOT appear.

    I even tried to encapsulated it within "windows.onload" but it does not help.

    I do not wish to move into html codes as it'll main future administration very difficult. Is there anyway to still assign value within the different landing pages using the same form?

  • Sainathk
    Sainathk Posts: 9 Red Ribbon
    edited Mar 5, 2021 12:38PM

    Hi Farrell,

    Could you please copy the below script and replace the existing one? Don't forget to copy beginning </script>. without this tag, it won't work. Just copy-paste the below one.

    </script><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>



    document.getElementById("fe2471").value = "Landingpage1";


    You have to add this code to each page you are creating and replace the "Landingpage1" with some other value



  • Farrell
    Farrell Posts: 25 Green Ribbon

    Thank you very much @HongTai & @Sainathk

    It seems like I need to use:

    • Javascript - To set the hidden file upon windows.onload
    • QueryString field merge - To map the QueryString from the URL into the common form
    • Form Processing - To write the data from the URL QueryString into the CDO fields

    The difficult part is actually the setting of the date information because Eloqua is in EST but Javascript Date.Now() formula only picks up user's computer datetime. Even if I use toLocaleString() function, the best is UTC, so the recorded datetime in the CDO will be different from what's Eloqua produce by default.

    Thanks to the both of you, I'm able to capture the information from various LP using the same form. Once again, thank you very much.