Welcome to the Instapage Support Center

|

Dynamic Text Replacement / How to use URL parameters on your page


You can also use UTM parameters as values for hidden fields.

Have more questions? Submit a request
Was this article helpful?
2 out of 3 found this helpful

Comments

  • Avatar
    - -

    It would be nice to see this as a text guide rather than a video.

  • Avatar
    Vlad Anciu

    Thanks for your input! We are looking into updating this tutorial!

  • Avatar
    Steve Bennett

    As you develop this feature further, please include the ability to test parameters during preview (notably, so we can evaluate the impact of different character lengths on design/positioning). Appending parameters to the preview URL doesn't appear to work at this time.

  • Avatar
    Steve Bennett

    You may need to perform additional testing. There seems to be some possible bugs in the current implementation. For example, if I pass values ?ABC=123&XYZ=789, then I notice that the value for ABC populates everywhere I've specified yet the value for XYZ only populates in a single instance (sometimes the first instance, sometimes the last instance). If you'd like to review my work, please contact me for a specific example.

    Edited by Steve Bennett
  • Avatar
    Andrei M.

    Steve, thank you for your input. We're definitely going to look into this. Can you please reach out to our support(help@instapage.com) regarding this? We'll be able to give you additional details from there. Thank you.

    Edited by Andrei M.
  • Avatar
    - -

    Second an earlier comment. Would greatly prefer text guide. Just for future reference.

  • Avatar
    Netleads Group

    I made a comment but it is deleted or its not showing?

  • Avatar
    Joe Zulli

    Is there a way to provide default text if the url parameter is missing?

  • Avatar
    Cristina

    Hi Joe! Please drop us a quick email at help@instapage.com and let us know on which page are you working on. My colleagues can help you with this.

  • Avatar
    Mark Lesiw

    Second Joe's ask. How can we do default text?

  • Avatar
    Andrei M.

    Hi Netleads Group, I'm not sure why your previous comment didn't arrive, but I noticed your matter was already discussed on support and with our tech team and the ticket was resolved. Let us know if you're still having any trouble? Sorry for the confusion.

  • Avatar
    Cristina

    Hi Mark! This script needs to be added on page in Settings - HTML/CSS - header.

    $(document).ready(function() {
    var urlParameter = "city";
    var defaultValue = "San Francisco";
    if (document.location.search.length) {
    console.log("We have parameters in the URL");
    } else {
    $("p:contains('[" + searchedText + "]')").each(function(i, element) {
    var content = $(element).html();
    content = content.replace(searchedText, defaultValue);
    $(element).html(content);
    }); //each
    }
    }); // ready

    Please make sure you change var urlParameter = "city"; and var defaultValue = "San Francisco"; to your default text. If you need further assistance with this please get back to us at help@instapage.com

Need Further Help?

Tell us what you need and we will be happy to assist you.

Our team of expert support staff and our community can answer your questions. Submit a ticket, reach out on live chat or call us now!