Installation Methods
Clicky can be installed via direct code placement, CMS plugins, or tag managers. Choose the method that best fits your technical setup.
Direct JavaScript Installation
Standard Installation
Add this code to every page of your website, just before the closing </body> tag:
<script>
var clicky_site_ids = clicky_site_ids || [];
clicky_site_ids.push(YOUR_SITE_ID);
</script>
<script async src="//static.getclicky.com/js"></script>
With Tracking Image Fallback
For visitors with JavaScript disabled:
<script>
var clicky_site_ids = clicky_site_ids || [];
clicky_site_ids.push(YOUR_SITE_ID);
</script>
<script async src="//static.getclicky.com/js"></script>
<noscript>
<img alt="Clicky" width="1" height="1" src="//in.getclicky.com/YOUR_SITE_IDns.gif" />
</noscript>
Asynchronous Best Practice
The async attribute ensures Clicky doesn't block page rendering:
<!-- Recommended: async loading -->
<script async src="//static.getclicky.com/js"></script>
<!-- Alternative: defer loading -->
<script defer src="//static.getclicky.com/js"></script>
CMS-Specific Installation
WordPress
Using the Official Plugin:
- Go to Plugins → Add New
- Search for "Clicky Analytics"
- Install and activate the plugin
- Navigate to Settings → Clicky
- Enter your Site ID and Site Key
- Save settings
Manual Installation:
Edit your theme's footer.php and add the tracking code before </body>:
<script>
var clicky_site_ids = clicky_site_ids || [];
clicky_site_ids.push(<?php echo YOUR_SITE_ID; ?>);
</script>
<script async src="//static.getclicky.com/js"></script>
<?php wp_footer(); ?>
</body>
Shopify
- Go to Online Store → Themes
- Click Actions → Edit code
- Open
theme.liquid - Add tracking code before
</body>:
<script>
var clicky_site_ids = clicky_site_ids || [];
clicky_site_ids.push(YOUR_SITE_ID);
</script>
<script async src="//static.getclicky.com/js"></script>
</body>
Squarespace
- Go to Settings → Advanced → Code Injection
- Paste the tracking code in the Footer section
- Save changes
Wix
- Go to your site dashboard
- Click Settings → Tracking & Analytics
- Click + New Tool → Custom
- Paste the tracking code
- Set placement to "Body - end"
- Apply to all pages
Webflow
- Open Project Settings
- Go to the Custom Code tab
- Paste tracking code in Footer Code
- Publish your site
Tag Manager Installation
Google Tag Manager
- Log into Google Tag Manager
- Click Tags → New
- Name the tag "Clicky Analytics"
- Choose Custom HTML as tag type
- Paste the tracking code:
<script>
var clicky_site_ids = clicky_site_ids || [];
clicky_site_ids.push(YOUR_SITE_ID);
</script>
<script async src="//static.getclicky.com/js"></script>
- Set trigger to All Pages
- Save and publish
Other Tag Managers
Clicky works with any tag manager that supports custom JavaScript:
- Tealium: Add as Custom Container tag
- Adobe Launch: Create a custom Core extension rule
- Segment: Use destination functions
Single-Page Applications
React
// In your App.js or layout component
import { useEffect } from 'react';
import { useLocation } from 'react-router-dom';
function App() {
const location = useLocation();
useEffect(() => {
// Load Clicky once
if (!window.clicky_site_ids) {
window.clicky_site_ids = [YOUR_SITE_ID];
const script = document.createElement('script');
script.src = '//static.getclicky.com/js';
script.async = true;
document.body.appendChild(script);
}
}, []);
// Track route changes
useEffect(() => {
if (window.clicky) {
window.clicky.log(location.pathname, document.title);
}
}, [location]);
return <YourApp />;
}
Vue.js
// In router/index.js or main.js
router.afterEach((to, from) => {
if (window.clicky) {
window.clicky.log(to.path, to.meta.title || document.title);
}
});
// Initial load in App.vue
mounted() {
window.clicky_site_ids = [YOUR_SITE_ID];
const script = document.createElement('script');
script.src = '//static.getclicky.com/js';
script.async = true;
document.body.appendChild(script);
}
Next.js
// pages/_app.js
import { useEffect } from 'react';
import { useRouter } from 'next/router';
import Script from 'next/script';
function MyApp({ Component, pageProps }) {
const router = useRouter();
useEffect(() => {
const handleRouteChange = (url) => {
if (window.clicky) {
window.clicky.log(url, document.title);
}
};
router.events.on('routeChangeComplete', handleRouteChange);
return () => {
router.events.off('routeChangeComplete', handleRouteChange);
};
}, [router.events]);
return (
<>
<Script id="clicky-config" strategy="beforeInteractive">
{`var clicky_site_ids = clicky_site_ids || []; clicky_site_ids.push(YOUR_SITE_ID);`}
</Script>
<Script src="//static.getclicky.com/js" strategy="afterInteractive" />
<Component {...pageProps} />
</>
);
}
Verification
Confirm Installation
- Visit your website in a new browser/incognito window
- Open Clicky dashboard → Real-time
- Your visit should appear within seconds
Check Page Source
- Right-click on your page → View Page Source
- Search for "clicky" or your Site ID
- Verify the script tags are present
Browser Developer Tools
- Open Developer Tools (F12)
- Go to Network tab
- Filter by "clicky"
- Refresh the page
- You should see requests to
static.getclicky.comandin.getclicky.com
Common Installation Issues
Script Not Loading
- Check for typos in the Site ID
- Verify the script isn't blocked by CSP headers
- Ensure no JavaScript errors prevent execution
Duplicate Tracking
- Remove any duplicate tracking code instances
- Check both theme files and plugins/extensions
- Verify tag manager isn't firing twice
Wrong Site ID
Each website needs its own Site ID. Using the wrong ID sends data to the wrong property.