better README

This commit is contained in:
Karl Breuer 2025-04-13 18:21:33 +02:00
parent 1c337a34c9
commit 78ab65fccf
2 changed files with 52 additions and 19 deletions

View File

@ -1,30 +1,58 @@
# Palantics Tracker Helper
A tool that counters anti-tracking measures by removing third-party requests. Your server will do the requests instead.
A server-side solution that enhances tracking capabilities by handling third-party requests directly from your server, effectively bypassing anti-tracking measures.
This is the recommended way to setup palantics. But only using the frontend script with the tracker server directly does work as well :)
While direct integration between the frontend script and tracker server is possible, this helper provides a more robust solution recommended for production environments.
## Installation
## WordPress Plugin Installation
### 1. Copy or clone this repo to your server
The WordPress plugin includes the helper functionality integrated into the PHP backend for seamless operation.
1. Copy the contents of the WordPress folder to your WordPress plugins directory
2. Configure the tracker endpoint with your domain in the plugin settings
3. Track click events by either:
- Wrapping elements in the Analysis block
- Using the onclick attribute on elements:
```html
<div onclick="tE('eventName')">Your content</div>
```
### WordPress Plugin Features
- Automatic configuration of most tracking requirements
- Click event tracking for selected elements
- Class-based automatic tracking (configurable in settings)
- Built-in pageload tracking
> **Note:** If you're using WordPress, your installation is now complete. The remaining sections are only necessary for non-WordPress environments.
## General Helper Installation
For non-WordPress environments, use our general helper service.
### Step 1: Server Setup
```bash
# Clone the repository
git clone https://gitea.karlbreuer.com/karl/palanticshelper.git
cd palanticshelper
# Configure environment
cp example.env .env
```
Edit your `.env` file and make sure you use the correct tracking server.
Edit your `.env` file to set the correct tracking server endpoint, then start the service:
```bash
docker-compose up -d
```
### 2. Update your Reverse Proxy config
### Step 2: Reverse Proxy Configuration
Configure your reverse proxy to catch requests and forward them to Palantics Helper.
Configure your reverse proxy to forward tracking requests to the Palantics Helper.
Remember to set the PORT correctly to match your .env PORT.
#### NGINX:
#### NGINX Configuration:
```nginx
location /spur {
@ -36,10 +64,9 @@ location /spur {
}
```
#### Traefik:
#### Traefik Configuration:
```yaml
# Traefik configuration
labels:
- "traefik.enable=true"
- "traefik.http.routers.palantics.rule=Host(`yourdomain.com`) && PathPrefix(`/spur`)"
@ -48,15 +75,20 @@ labels:
- "traefik.http.services.palantics.loadbalancer.server.port=8101"
```
### 3. Update Global Server Config
### Step 3: Frontend Integration
In the global server config in your frontend, replace the tracker endpoint with your own domain:
Add the tracking script from the `script` folder to your site's header.
### Step 4: Implement Event Tracking
Track user interactions by adding the `onclick` attribute to elements:
```html
<!-- Global server config -->
<script>
const server = "https://karlbreuer.com";
</script>
<div onclick="tE('eventName')">Your content</div>
```
INSTEAD of your tracker endpoint `https://tracking1.karlbreuer.com`
The tracker automatically collects pageload data without additional configuration.
## Additional Plugins
Support for other platforms is under development. Check back for updates.

View File

@ -1,4 +1,5 @@
<!-- TRACKING SCRIPT -->
<!-- To be placed in the header -->
<!-- Global server config -->
<script>
const server = window.location.origin;