How to Integrate the HeavySet Tech Form into Your Webpage

Introduction

This article provides guidance on integrating the HeavySet Tech Form into your webpage. It addresses common issues related to domain security that may prevent the form from displaying correctly during development or on live sites.

Steps to Integrate the Form

1. Replace Existing Form Code

Replace your existing form code with the HeavySet Tech form code provided. Below is an example:

<div id="iframeContainer"></div>
<script>
  var script = document.createElement('script');
  script.src = "https://cdn.heavyset.tech/iframe-loader.min.js";
  script.onload = function() {
    window.injectHeavySetIframe('YOUR_TOKEN_ID', 'iframeContainer', 'min-width: 350px; max-width: 100%; height: 590px; border: none;');
  };
  document.body.appendChild(script);
</script>

Note: Replace 'YOUR_TOKEN_ID' with the actual token ID.

2. Generate a Token for Your Domain

The HeavySet Tech form uses domain-based security and will not display on a domain not assigned to your token. To generate a token:

  • Visit the HeavySet Tech Setup Tutorial for detailed instructions.
  • Generate a token for the domains you intend to use.

Example: For a live site with the domain example.com , create a token with the domain example.com .

Note for Local Development:

If you're testing locally on localhost:5006 , create a token with the domain localhost.5006 (note the use of a period instead of a colon).

3. Update the Token in Your Code

Ensure that the token ID in your script matches the one generated for your domain.

window.injectHeavySetIframe('YOUR_TOKEN_ID', 'iframeContainer', 'min-width: 350px; max-width: 100%; height: 590px; border: none;');

4. Test the Form

Load your webpage to verify that the form displays correctly. If the form does not appear:

  • Confirm that the domain in your browser matches the domain assigned to your token.
  • Ensure that the token ID is correctly inserted in your code.

Troubleshooting Common Issues

  • Form Not Displaying Locally: If testing on a local server, ensure you've generated a token for your local domain (e.g., localhost.5006 ).
  • Console Errors About Domain Security: This indicates a mismatch between your webpage's domain and the domain assigned to your token. Double-check both for consistency.

Conclusion

By following these steps and ensuring that your token's domain matches your webpage's domain, you should successfully integrate the HeavySet Tech Form into your site. For additional assistance, refer to the HeavySet Tech Setup Tutorial or contact support.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.