Skip to content

reconurge/recontrack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Recontrack

Recontrack is a command-line tool and Python library designed to extract tracking codes from websites.
It follows redirects, downloads the full HTML content, and scans embedded scripts to identify tracking IDs from popular platforms such as Google Analytics, Facebook Pixel, Google Tag Manager, Hotjar, LinkedIn Insight, and others.


Features

  • Follow HTTP redirects to get the final page URL
  • Extract tracking codes from HTML and JavaScript
  • Detect multiple popular tracking services using regex patterns
  • Provide a simple CLI for quick usage
  • Python module for integration in your own projects

Installation

Using virtualenv (recommended)

  1. Install virtualenv if necessary:
pip install virtualenv
  1. Create and activate a new virtual environment:
virtualenv recontrack-env
source recontrack-env/bin/activate
  1. Install Recontrack locally (run this command in the project root where setup.py is located):
pip install -r requirements.txt

Usage

Command-line interface (CLI)

After installation, use the recontrack/cli.py command:

python3 recontrack/cli.py <url>

Example:

python3 recontrack/cli.py https://example.com

Sample output:

Fetching content from: https://example.com
Final URL after redirects: https://www.example.com
Found tracking codes:
 - Google Analytics (UA): UA-12345678-1
 - Facebook Pixel: 123456789012345

For help:

python3 recontrack/cli.py -h

Python module

You can also use Recontrack programmatically:

Add to your requirements.txt:

# requirements.txt
git+https://github.com/reconurge/recontrack.git

Or install using python:

pip install git+https://github.com/reconurge/recontrack.git

Use in the command line:

recontrack <url>

Or import as a module.

from recontrack import TrackingCodeExtractor

extractor = TrackingCodeExtractor("https://example.com")
extractor.fetch()
extractor.extract_codes()
results = extractor.get_results()

for tracking in results:
    print(f"{tracking.source}: {tracking.code}")

Dependencies

  • Python 3.6+
  • requests
  • beautifulsoup4

These dependencies are automatically installed via pip when you install the package.


Development

  • Core code is in the recontrack/ package
  • CLI script is in recontrack/cli.py
  • Tests can be added in a tests/ folder

License

MIT License.

About

A CLI tool that sniffs out tracking codes from websites by analyzing their HTML and embedded scripts.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages