Skip to main content

Overview

This guide shows you how to integrate Inhouse analytics into your Chrome extension to track installs, uninstalls, and user engagement without requiring the full SDK. for sdk approach please refer to the sdk docs.

Prerequisites

Setup

1. Get Your Inhouse Domain

  1. Register at app.tryinhouse.co
  2. You’ll receive a domain like your-project.inh.sh
  3. Optionally, configure a custom domain
  4. https://your-project.inh.sh/chrome/install?url= route is automatically created for you.
In your Inhouse dashboard, create two type lif links:
  1. links that you would want to share - think of each link as a unique campaign. links for campaign level racking.
  2. Uninstall Tracker: your-project.inh.sh/uninstall (dedicated uninstall tracking link)
Inhouse Dashboard Create Tracking Links

Implementation

Track Extension Installs

Add this code to your extension’s background script to track new installations:
chrome.runtime.onInstalled.addListener(async (details) => {
  if (details.reason === 'install') {
    console.log('Extension installed - tracking with Inhouse...');
    
    // Your target URL after installation
    const targetUrl = 'https://your-app.com/welcome';
    
    // Inhouse tracking URL with redirect
    const trackingUrl = `https://your-project.inh.sh/chrome/install?url=${encodeURIComponent(targetUrl)}`;
    
    // Open the tracking URL (will redirect to your target URL with referrer data)
    await chrome.tabs.create({
      url: trackingUrl,
      active: true
    });
  }
});
How it works: The tracking URL redirects to your target URL with referrer parameters like ?refer_code=FOCKS&other_params=123 and other params that you would want to track, enabling you to track the source of each install.

Track Extension Uninstalls

Add uninstall tracking to your extension:
chrome.runtime.setUninstallURL('https://your-project.inh.sh/uninstall');
Note: Chrome extensions have limited time during uninstall, so the uninstall URL should be lightweight and fast-loading.

Advanced Configuration

Custom Install Flow

For more control over the install experience:
chrome.runtime.onInstalled.addListener(async (details) => {
  if (details.reason === 'install') {
    // Show welcome page first
    await chrome.tabs.create({
      url: 'chrome-extension://__MSG_@@extension_id__/welcome.html'
    });
    
    // Track install after user interaction
    setTimeout(async () => {
      const trackingUrl = `https://your-project.inh.sh/chrome/install?url=${encodeURIComponent('https://your-app.com/dashboard')}`;
      await chrome.tabs.create({ url: trackingUrl });
    }, 2000);
  }
});

Analytics Dashboard

Once implemented, your Inhouse dashboard will track:
  • Total clicks on your tracking links
  • Unique clicks (deduplicated by user)
  • Chrome extension installs via the install tracker
  • Uninstall events via the uninstall tracker
  • Conversion rates and user journey analytics

Need help? Contact our support team or check the Inhouse documentation.