How can we help?

Installing Tracking Code on a WordPress Website

Updated Date:

How to Install ClickSambo on a WordPress Website

To protect your WordPress site, install both ClickSambo tracking codes on every page.

You need two codes: the HEAD code (the main tracking script) and the BODY code (a NoScript fallback). For most users, the plugin method (Method A) is the safest and easiest option.

Step 1: Get Your Tracking Codes

  1. Log in to your ClickSambo dashboard.

  2. Go to Account Settings > Domain Tracking Setup.

  3. Select your domain and keep this tab open; you will copy the HEAD and BODY codes from here.

Step 2: Choose Your Installation Method

Method A: Use a plugin (recommended)

The safest way to add code without editing theme files.

  1. In your WordPress admin, go to Plugins > Add New.

  2. Search for WPCode – Insert Headers and Footers, install it and activate it.

  3. Go to Code Snippets > Header & Footer.

  4. Paste the HEAD code into the Header box and the BODY code into the Body box.

  5. Click Save Changes.

Method B: Use your theme settings

Only if your theme has built-in fields for custom scripts.

  1. Go to Appearance > Customize.

  2. Look for a section such as "Theme Settings", "Custom Code" or "Scripts".

  3. Paste the HEAD code into the header field and the BODY code into the body field.

  4. Publish your changes. If your theme only has a header field, use Method A instead.

Method C: Google Tag Manager (GTM)

If you already use Google Tag Manager, follow our GTM installation guide instead of the methods above.

Method D: Edit theme files (advanced)

Warning: Only for advanced users. Always use a child theme so your changes are not lost when the theme updates.

  1. Go to Appearance > Theme File Editor.

  2. Select your child theme and open header.php.

  3. Paste the HEAD code just before the closing </head> tag.

  4. Paste the BODY code just after the opening <body> tag.

  5. Click Update File and check that your site still loads correctly.

Step 3: Clear Your Cache

Clear your website cache after installation so visitors receive the updated pages.

  • In your caching plugin (e.g., WP Rocket, LiteSpeed Cache, W3 Total Cache), purge all caches.

  • If you use Cloudflare or another CDN, clear that cache too.

Step 4: Verify the Installation

  1. Open your website in an incognito/private window.

  2. Right-click the page and select View Page Source.

  3. Press Ctrl+F (Cmd+F on Mac) and search for cdn.clicksambo.com (HEAD code) and ping.clicksambo.com (BODY code).

Both codes found? The tracking codes are installed correctly. Make sure your Google Ads account is connected as well, so ClickSambo can protect your campaigns.

Did this answer your question?
  • clicksambo-sad
  • clicksambo-neutral
  • clicksambo-happy
Partner Program

Ready to grow with ClickSambo?

Join our partner program and turn ad-fraud protection into a scalable, recurring revenue stream.

Apply to the program
close

ClickSambo support is available!

Whatsapp Sohbet
Customise Consent Preferences
Cookies
Cookies Other
Always Active

Other uncategorised cookies are those that are being analysed and have not been classified into a category as yet.

Cookies Advertisement

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

Cookies Analytics

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

Cookies Performance

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.