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
- Go to Marketing > Funnels and open a funnel
- Click Analytics in the top toolbar
- In the Analytics canvas, click Tracking code in the top toolbar
- Select and copy the complete Embed code from the pop-up window
Install the tracking code in an external page
- Log in to the hosting service where your external page is located and open the page for editing.
- 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.)
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.
- Go back to Kartra and add the URL for the page where you placed the code:
- In the real-time analytics canvas, locate the object in the funnel flow that represents the external page
- Click the object and click Configure
- 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:
- The funnel tracking code must exist in the source code of the external page, and
- 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:
- Navigate to the WordPress dashboard.
- Go to Appearance > Theme Editor.
- Find the
footer.php
orheader.php
file. - Paste the tracking code just before the closing
</body>
or</head>
tag. - 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:
- Go to Settings in your site's dashboard.
- Click the Custom Code tab in the Advanced section.
- Click + Add Custom Code at the top right.
- Paste the code snippet in the text box.
- Enter a name for your code.
- Tip: Give it a name that is easy to recognize so you can quickly identify it later.
- 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.
- Choose where to place your code under Place Code in:
- Head
- Body - start
- Body - end
- 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:
- Open the Developer tools panel.
- Click Code Injection.
- Add valid HTML or scripts into the appropriate Code Injection fields for the header, footer, lock page, order confirmation page, or order status page.
- 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