Skip to content

How to configure a custom URL for your proposals

By default, your proposals are accessible through a URL in the form:

https://app.ieco.io/reports/e48662b4c753756ce5a75d174c1ed7e6404babe4

You may want to change this so that all proposals are accessible through your own domain. If that is the case, and assuming you want to use a URL in the form:

http://yourdomain.com/proposals?id=e48662b4c753756ce5a75d174c1ed7e6404babe4

You will need to make a proposals.html page that does the following:

  • Read the URL to extract the id parameter.
  • Use the id parameter to infer the proposal URL.
  • Load the inferred proposal URL using an iframe.

Using HTML, CSS and JavaScript you can do this pretty easily:

html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Proposal</title>
  <style>
    #ieco-iframe {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      border: none;
    }
  </style>
</head>
<body>
  <!-- iframe container -->
  <div>
    <!-- The iframe will be loaded here -->
    <iframe id="ieco-iframe" src="https://app.ieco.io/reports/placeholder" frameborder="0"></iframe>
  </div>

  <!-- Script to modify the iframe URL -->
  <script>
    // Function to get the proposal UUID from the current URL
    function getProposalUuid() {
      const urlParams = new URLSearchParams(window.location.search);
      return urlParams.get('id');
    }

    // Function to update the iframe URL with the retrieved proposal UUID
    function updateIframe() {
      const iframe = document.getElementById('ieco-iframe');
      const uuid = getProposalUuid();
      iframe.src = `https://app.ieco.io/reports/${uuid}`;
    }

    // Call the function on page load to initially update the iframe URL
    updateIframe();
  </script>
</body>
</html>