Skip to main content
All CollectionsHow-To Guide
Embedding Web Intelligence Tracking Code into Your Website(s)
Embedding Web Intelligence Tracking Code into Your Website(s)

Adding the Tracking Code into your website(s) is the last step to successfully enable KnowledgeNet.ai Web Traffic Intelligence.

Alyssa Theodore avatar
Written by Alyssa Theodore
Updated over a week ago

HTML Header/Footer

  1. Figure out where in your HTML file you want to add the code. Generally, either the header or footer of the document is going to be your best bet.

  2. Place a <script> tag inside of the chosen field.

  3. Place the JavaScript code inside of the <script> tag.

  4. Save the changes you’ve made and upload the edited HTML file to your site.


Google Tag Manager

  1. Navigate to Google Tag Manager and click Tags -> New.

  2. Click on Tag Configuration and then select Custom HTML.

  3. Insert the JavaScript code that you want and save the changes.

  4. Choose Page View as the triggering option.

  5. Go to the top right corner of the page and click Publish to save the changes.


WordPress

Method 1 – Using WordPress Admin Portal

  1. Log in to your WordPress Admin Panel.

  2. Go to Appearance -> Editor (make sure you’re selecting theme editor here).

  3. Select either Footer.php or Index.php.

  4. Find the </body> HTML tag.

  5. Copy and paste the tracking code before the </body> tag.

  6. Click Update File to save the changes.

Method 2 – Using Header-Footer Plugin

  1. Download and install WordPress’ Header-Footer plugin.

  2. Go to Settings -> Header-Footer.

  3. Paste the JavaScript code that you want in the Bottom Footer textbox.


Squarespace

Use Code Injection to add custom code to the header or footer:

  1. Navigate menu: Settings -> Advanced -> Code Injection.

  2. Add your code in the Header or Footer text fields.

  3. Click Save to save your changes.


WIX

  1. Log into your WIX account and click on Settings.

  2. Click on: Advanced -> Custom Code.

  3. Click + (Add Custom Code) at the top right of screen.

  4. Setup Custom Code: Add script below to end of standard script:

    <script type="text/javascript">

    var pushState = history.pushState;

    history.pushState = function () {

    pushState.apply(history, arguments);

    ll_track();

    };

    window.addEventListener('popstate', function(){ll_track()});

    </script>

  5. Paste ALL the JavaScript code (standard + extra script) into the field.

  6. Name your code so that you can keep track of it.

  7. Click Add Code to Pages: ALL Pages.

  8. Place code in: Head.

  9. Click Apply to make the changes live.


HubSpot

  1. Log into your HubSpot account and navigate to Marketing -> Files -> Templates -> Design Tools.

  2. Locate the left sidebar menu and click Actions -> New File. If you don’t see this, you may need to expand the Folder Icon to find the menu options.

  3. In the dialog box, click on the label marked JavaScript.

  4. Then enter a name for your JavaScript file when prompted to do so.

  5. Paste the JavaScript code into the editor.

  6. Go to the upper-right corner of the page and click Publish Changes to make them live.


Shopify

  1. Go to assets folder and add a New Asset.

  2. Create new JavaScript file called knowldgenet.js (not liquid).

  3. Insert the JavaScript code that you want and save the changes. Be sure to remove the <script> and </script> html tags from the code you paste into the editor.

  4. Save the knowledgenet.js file.

  5. Open theme.liquid file.

  6. Paste the following into the file before, after or in between any existing scripts:

<script src=”{{ 'knowledgenet.js' | asset_url }}” defer=”defer”></script>

or

<script src=”{{ 'knowledgenet.js' | asset_url }}” async></script>


Duda

Site-Wide Header

  1. Open the Duda editor.

  2. Go to left panel: Settings -> Header HTML.

  3. Paste the JavaScript code and Save.

Single Page Header

  1. In the side panel, click Pages.

  2. On the page you want to add into, click Settings-SEO.

  3. Go to Header HTML.

  4. Paste the JavaScript code and Save.

Place Code After the Opening Body Tag

  1. Open the Duda editor.

  2. Go to left panel: Settings -> Head HTML.

  3. Paste the JavaScript code into BODY END HTML field and Save.

Did this answer your question?