Use the Kartra tracking code to see visits on pages hosted outside Kartra included in your account analytics. A unique tracking code is generated for each funnel in your account and can be found in the real-time analytics dashboard.

Web pages or sites built and hosted outside of Kartra are considered "external" to your account. If external locations are part of a funnel you are tracking in Kartra, a unique embed code is required to ensure that Kartra can identify those pages as part of your flow.

When the tracking code is added to an external page, Kartra can display visitor statistics in the funnel's real-time analysis. 

Important:

If the external page has a Kartra object on it (such as a form, checkout, video player, etc.) the funnel tracking code is not needed. Tracking is already provided by the code you used to add the object to the page.


How to track external pages in real-time funnel analytics

The tracking code for Kartra funnels is in HTML format, using <script> tags.

Get the tracking code from Kartra

  1. Go to Funnels > Analytics
  2. Click Select funnel... in the top right of the page

    Select a funnel from the analytics drop-down

  3. Click the Tracking code button at the top of the canvas

    Funnel Real Time Tracking Code

  4. Select and copy the complete Embed code from the pop-up window

    Image3

Install the tracking code in an external page

  1. Log in to the hosting service where your external page is located and open the page for editing.
  2. Paste the Kartra tracking code just before the </body> or </head> tag in your external page source code. (Shown in the following image before the </body> tag. This tag is found at the very end of the source code.)

    Kartra embed script shown in web page source code

    Depending on your external page editor, you may have a dedicated field for this or you can add the code snippet directly to your source code.
    • If you are not sure how to edit your external page's source code, contact your web implementation team or website service for help. HTML coding knowledge may be required.
    • Guides for some common providers are provided in the next section to help you get started.
  3. Go back to Kartra and add the URL for the page where you placed the code:
    1. In the real-time analytics canvas, locate the object in the funnel flow that represents the external page
    2. Click the object and click Configure

      Add the external page URL to your Kartra funnel
    3. Paste the URL for the external page where the tracking code was added. Repeat this for any other external pages in the funnel.

Note: Tracking and displaying visitor data from an external source requires two parts

  1. The funnel tracking code must exist in the source code of the external page, and 
  2. The URL for the external page must be added to an asset object in the Kartra funnel flow.

Guides for common external hosts

Keep in mind that these instructions may change. If these steps do not match what you see in your account for these platforms, please visit the third-party tool's support page or contact their support team for the most up-to-date information. The Kartra support team will only be able to help with the Kartra side of the process.

Adding HTML code to WordPress

Adding code to a WordPress theme

WordPress allows users to edit theme files directly with these steps:

  1. Navigate to the WordPress dashboard.
  2. Go to Appearance > Theme Editor.
  3. Find the footer.php or header.php file.
  4. Paste the tracking code just before the closing </body> or </head> tag.
  5. Save changes.

Note: If you update the theme in the future, these changes will be lost. WordPress recommends using a child theme to avoid this.

Learn more about editing WordPress themes: https://wordpress.org/documentation/article/appearance-theme-file-editor-screen/

Adding code with a WordPress plugin

Install a plugin (like “Insert Headers and Footers” or “Header and Footer Scripts”) that allows you to paste the tracking code without editing theme files. Each plugin will have its own installation and use information.

Learn more about installing plugins in WordPress: https://wordpress.org/documentation/article/manage-plugins/ 

Adding HTML code to Wix

Wix site settings provide a space for custom code:

  1. Go to Settings in your site's dashboard.
  2. Click the Custom Code tab in the Advanced section.
  3. Click + Add Custom Code at the top right.
  4. Paste the code snippet in the text box.
  5. Enter a name for your code.
    • Tip: Give it a name that is easy to recognize so you can quickly identify it later.
  6. Select an option under Add Code to Pages:
    • All pages: This adds the code to all of your site's pages, including any new pages that you create in the future. Choose whether to load the code only once per visit, or on each page your visitor opens.
    • Choose specific pages: Use the drop-down menu to select the relevant pages.
  7. Choose where to place your code under Place Code in:
    • Head
    • Body - start
    • Body - end
  8. Click Apply.

Learn more about custom code in Wix: https://support.wix.com/en/article/embedding-custom-code-on-your-site

Adding HTML code to Squarespace

Squarespace has a code injection feature that can be used to add scripts and other custom code:

  1. Open the Developer tools panel.
  2. Click Code Injection.
  3. Add valid HTML or scripts into the appropriate Code Injection fields for the header, footer, lock page, order confirmation page, or order status page.
  4. After adding your code, click Save.

Learn more about Code injection in Squarespace: https://support.squarespace.com/hc/en-us/articles/205815908-Using-code-injection