Metadata-Version: 2.4
Name: pretix-tracking-scripts
Version: 1.0.2
Summary: Adds scripts for analytics and conversion tracking to pretix.
License: Apache-2.0
License-File: LICENSE
Author: Kian Cross
Author-email: kian@kiancross.co.uk
Requires-Python: >=3.11,<4.0
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: django (>=4.2.15,<5.0.0)
Requires-Dist: pretix
Project-URL: Repository, https://github.com/kiancross/pretix-tracking-scripts
Description-Content-Type: text/markdown

# pretix-tracking-scripts

[![PyPI version](https://badge.fury.io/py/pretix-tracking-scripts.svg)](https://pypi.org/project/pretix-tracking-scripts/)
[![License](https://img.shields.io/github/license/kiancross/pretix-tracking-scripts)](https://github.com/kiancross/pixy/blob/master/LICENSE)
[![codecov](https://codecov.io/gh/kiancross/pretix-tracking-scripts/graph/badge.svg?token=PHpYdVTJ3H)](https://codecov.io/gh/kiancross/pretix-tracking-scripts)

This plugin for [pretix](https://github.com/pretix/pretix) enables the addition of tracking scripts, including [Google Analytics](https://developers.google.com/analytics) and [Meta Pixel](https://www.facebook.com/business/tools/meta-pixel), to your store. It supports cookie consent but does not hide sensitive URLs, unlike the [official pretix solution](https://behind.pretix.eu/2019/02/02/trackers/).

## Installation

 1. Install the plugin:

    ```bash
    pip install pretix-tracking-scripts
    ```

 2. Enable the plugin on your event page.

 3. Once enabled, a new Settings link will appear in the event settings side-navigation bar. Use this to configure your tracking scripts:

     * Enter a Google Analytics Measurement ID.
     * Enter a Meta Pixel dataset ID.
    
    Tracking scripts are only included when a value is provided.

> [!IMPORTANT]
> This plugin does not specify any pretix version constraints. It is intended to remain compatible with future pretix releases, and adding explicit version limits would unnecessarily restrict where it can be used. The plugin has been explicitly tested with pretix `2025.10.1`. If you encounter any issues when using it with a later pretix release, please [open an issue](https://github.com/kiancross/pretix-tracking-scripts/issues/new) on this repository.

## Development

 1. Ensure you have a working [pretix development setup](https://docs.pretix.eu/en/latest/development/setup.html).

 2. Clone this repository.

 3. Install the plugin and dependencies:

    ```bash
    poetry install
    ```

If Pretix is not running within a virtual Python environment, or if your plugin and Pretix are operating in separate environments, you may want to install this plugin globally using the following command:

```bash
pip install -e .
```

### Code Styling

To automate code styling, run the following commands:

```bash
poetry run isort .
poetry run black .
```

### Automated Testing

To execute the automated tests, run the following command:

```bash
poetry run py.test tests
```

