If you use external tools to track visits, implement integrations, or enable specific features, you can add custom scripts to pages created with Hotmart Pages.
In this article, you’ll understand what scripts are, when it makes sense to use them, and how to configure them correctly on Hotmart Pages, including guidance on where to insert each type of script and best practices to avoid errors.
What are scripts and what are they used for?
Scripts are codes provided by external tools that allow you to add functionalities to your pages, such as traffic tracking, behavior analysis, integrations with other platforms, or specific features like chats and tracking pixels.
Each tool defines how the script should be inserted into the page. In general, these instructions indicate whether the code should be placed in the Head, Body, or the footer of the page to function correctly.
In Hotmart Pages, scripts can be inserted in different parts of the page, according to the external tool’s instructions:
- Head: recommended for scripts that need to load at the beginning of the page.
- Body: used for scripts that run throughout the page content.
Additionally, there is an alternative for scripts that need to be inserted in the footer of the page, before the closing </body> tag.
How to configure scripts on Hotmart Pages?
To add scripts to a page, follow these steps:
- Access your Hotmart account at https://app.hotmart.com/
- In the side menu, click Marketing and then Page creator.
- Inside Hotmart Pages, select My pages.
- Choose the page you want to configure and click Edit, or select Create page to start from scratch.
- In the editor, click the gear icon in the left menu to access Page settings.
- Select the Scripts option.
- Choose the script location according to the external tool’s instructions.
- Click Add script.
- Enter a name to make identification easier and paste the code into the indicated field.
- Click Save to finish.
Changes are automatically saved as a draft. To apply the script to the published version, click Publish.
How to add scripts to the page footer?
Some tools require the script to be inserted at the end of the page, before the closing </body> tag.
In these cases, you can use the Support Chat field available in the editor’s Settings menu. Although it is intended for chat integrations, this field also allows you to insert scripts in the page footer. Simply paste the code into the field and save as usual.
Best practices when adding scripts
To avoid issues with the page or the configured script, consider the following guidelines:
- Always follow the external tool’s instructions regarding where the script should be inserted.
- Check for extra spaces at the beginning or end of the code before pasting it.
- Use descriptive names when saving scripts to make identification and future edits easier.
If the script does not work as expected, review the configuration and confirm that the code was inserted in the correct location.