Overview
You can add Javascript to your landing pages. This helps you connect external tools and services.
Common use cases include:
Page tracking tools such as Google Analytics or Adobe Analytics
Form capture tools such as Chili Piper, ZoomInfo, or Jotform
Cookie and consent tools such as OneTrust or TrustArc
Image tracking pixels such as Litmus or Eventbrite
Where to Add JavaScript
You can add custom code inside the landing page builder.
Step-by-Step
Open your landing page in the builder
Click the Info tab
Scroll to the bottom of the right panel
Locate the following fields:
Tracking β Header
Tracking β Footer
Understanding Tracking Fields
Tracking β Header
Use this field to add code inside the <head> section of your page. Adding JavaScript to the header can impact page load performance, so it should only be used for scripts essential for initial rendering or required by third-party tools.
Best for:
Scripts that should not be visible
Tracking tools such as Google Tag Manager
Third-party tools that specify header placement
Example use cases:
Analytics scripts
Tag management tools
Tracking β Footer
Use this field to add code at the bottom of the <body> section. Placing JavaScript in the footer improves page load performance by ensuring scripts load after the page has rendered, which also ensures all page elements are available for interaction.
Best for:
Scripts that should load last
Tools that depend on page content
Scripts that require all page elements to be available before execution
Example use cases:
Image tracking pixels
Form capture scripts
Best Practices
Place critical tracking scripts in the Header
Confirm scripts load correctly using browser developer tools- Prioritize placing scripts in the footer to enhance page load performance
Use the header only for scripts essential for initial rendering or required by third-party tools
Place non-critical scripts in the Footer
Test your page after adding code
Need more help? Contact support via live chat within Knak using the chat bubble in the bottom right corner or email support@knak.com

