Skip to main content

Add Javascript to Knak Landing Pages

Easily connect external tools and tracking systems by adding custom code to your landing pages.

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

  1. Open your landing page in the builder

  2. Click the Info tab

  3. Scroll to the bottom of the right panel

  4. Locate the following fields:

    • Tracking – Header

    • Tracking – Footer

Info tab location and tracking fields

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

Did this answer your question?