← All platforms

    Installation Guide · WordPress

    How to Add Agent Analytics to Your Website

    One script captures what visitors browse. That becomes memory your analytics can understand. And agents like Jack turn it into actions — recovery emails, demand segments, conversion insights.

    Install on WordPress

    📰

    WordPress

    WordPress offers multiple ways to add custom scripts. We recommend using a plugin for safety, but the theme editor works too.

    Easy·2 min·2 methods

    Method 1: Use a Plugin (Recommended)

    This is the safest method. Your tracking script will survive theme changes and updates.

    Prerequisites

    • WordPress admin access
    • Ability to install plugins
    1
    Log in to your WordPress dashboard and go to Plugins → Add New

    This is the main WordPress admin area. You can usually access it at yoursite.com/wp-admin

    2
    Search for "Insert Headers and Footers" or "WPCode"

    Both are free, trusted plugins with millions of installs. WPCode is the newer one with more features.

    Tip: Look for the plugin by WPCode (formerly Insert Headers and Footers) — it's the most popular option.

    3
    Click Install Now and then Activate

    After clicking Install Now, the button will change to Activate. Click it to enable the plugin.

    4
    Go to Code Snippets → Header & Footer (or Settings → Insert Headers and Footers)

    The menu location depends on which plugin you installed. WPCode puts it under Code Snippets.

    5
    Paste the tracking script into the Header section

    This is the section labeled 'Header' or 'Scripts in Header'. Do NOT put it in the Body or Footer section.

    Paste this
    <script async src="https://analytics.tradly.dev/tracker.js" data-server="https://analytics.tradly.dev" data-project="marketplace"></script>
    6
    Click Save or Save Changes

    Your changes are live immediately. No need to clear any cache unless you're using a caching plugin.

    Plugin method survives theme changes and WordPress updates.

    Troubleshooting (3 common issues)
    • If you don't see the plugin menu, try refreshing the admin page
    • Some caching plugins (WP Rocket, W3 Total Cache) may need their cache cleared after adding the script
    • If you're using a CDN like Cloudflare, the script should still work — no purge needed

    Method 2: Theme Editor (Direct)

    Edit your theme files directly. Only recommended if you're comfortable editing code.

    Prerequisites

    • WordPress admin access
    • A child theme (recommended) or a theme you won't update
    1
    Go to Appearance → Theme File Editor

    This is under the Appearance menu in the left sidebar of your WordPress dashboard.

    Warning: Editing theme files directly can break your site if done incorrectly. Always use a child theme.

    2
    On the right side, find and click Theme Header (header.php)

    This file contains the <head> section of your site. It may also be called "header.php" in the file list.

    3
    Find the opening <head> tag

    Scroll through the file until you see the <head> tag. It's usually near the top of the file.

    Tip: Use Cmd+F (Mac) or Ctrl+F (Windows) to search for <head>

    4
    Paste the tracking script on the line right after <head>

    Don't replace anything — just add a new line and paste. The script should be one of the first things inside <head>.

    Paste this
    <script async src="https://analytics.tradly.dev/tracker.js" data-server="https://analytics.tradly.dev" data-project="marketplace"></script>
    5
    Click Update File

    The button is at the bottom of the editor. Wait for the "File edited successfully" message.

    Troubleshooting (3 common issues)
    • If you get a permission error, your hosting may block theme editing — use the plugin method instead
    • If the file reverts after updating, your host may have file permissions set to read-only
    • After a theme update, you'll need to re-add the script (unless you're using a child theme)

    Need help? Contact support@tradly.dev or check our FAQ.

    Last updated: January 2025