Back to site

Documentation

Product guides, API references, and integration manuals

Welcome to the documentation hub for all products and tools by Piotr Litwa. Use the sidebar to navigate between products, or browse the overview below.

Product Overview

Cookie Banner Pro

GDPR-compliant cookie consent for WordPress with Google Consent Mode v2, cookie scanner, and GTM template export.

Free + Premium

MarketBridge

Sell WooCommerce products across 50+ European marketplaces from one dashboard.

SaaS

AI Translator for Polylang

Automatic WordPress post translation using Claude or ChatGPT with Polylang integration.

Plugin

Litwa Translate

Modular multilingual solution with AI, Gutenberg blocks, and Kadence theme integration.

Plugin

WP Direct GA4

Lightweight GA4 via Measurement Protocol. 2KB JS, full WooCommerce, $0 cost.

Free

WP Pixel Hub

Universal server-side tracking hub — GA4, Facebook CAPI, TikTok, Pinterest, LinkedIn & more.

Plugin

First-Party Data Proxy

PHP proxy serving tracking pixels from your domain. Bypasses ad blockers.

Self-hosted

GTM First-Party Plugin

WordPress plugin to proxy GTM from your own domain. Architecture phase.

In Development
All products integrate with Google Consent Mode v2 and are designed to work together as a privacy-first analytics stack.

Cookie Banner Pro

GDPR-compliant cookie consent management for WordPress

Free Plugin Premium: Cross-Domain Sync

Overview

Cookie Banner Pro is a lightweight (~3KB gzipped) WordPress plugin that provides full GDPR/RODO-compliant cookie consent management. It features a customizable frontend banner, automated cookie detection, Google Consent Mode v2 integration, and GTM template generation.

Cookie Banner — Frontend Preview
Replace with: screenshot of the banner on a live site

3 Button Modes

Accept All + Reject All + Settings, or simplified 2-button variants.

12 Languages

PL, EN, DE, FR, ES, IT, CS, UK, PT, NL, SV, RO with auto-detection.

Cookie Scanner

Hybrid server-side + client-side detection with 30+ known cookies.

GTM Export

Download ready-to-import GTM container JSON with triggers per category.

Features

Banner Display

  • Positions: Bottom, Top, or Center (fullscreen, modal, or bar)
  • Layouts: Bar (horizontal strip) or Box (contained)
  • Animations: Fade, slide-up, slide-down, bounce, or none
  • Customizable: Colors, logo, border radius, font size, custom CSS
  • Re-open button: Persistent icon for revisiting preferences
  • Accessibility: Full keyboard navigation, Tab/Shift+Tab focus trap, ARIA labels
Banner Display Modes — Bar vs Box layout
Replace with: comparison screenshot showing bar and box layout

Cookie Categories

  • Default: Necessary (always required), Analytics, Marketing
  • Custom: Unlimited user-defined categories
  • Multilingual: Name + description in 12 languages
  • GCM Mapping: Each category maps to Google Consent Mode parameters

Script Blocking

Pattern-based blocking for 40+ known tracker patterns (Google Analytics, Facebook, LinkedIn, TikTok, Criteo, etc.). Scripts are dynamically activated when categories are granted via the cbp:consent event.

Installation

  1. Download the plugin ZIP from your account or WordPress.org
  2. Go to WordPress Admin → Plugins → Add New → Upload Plugin
  3. Upload the ZIP file and click Install Now
  4. Activate the plugin
  5. Navigate to Cookie Banner → Settings → General
  6. Check Enable Banner and set your Privacy Policy URL
  7. Save changes — the banner now appears on your site
Requirements: WordPress 5.8+, PHP 7.4+. No external dependencies — vanilla JS frontend.
WordPress Admin — Plugin Activation
Replace with: screenshot of WP Plugins page with CBP activated

Configuration

TabKey Options
GeneralEnable/Disable, Position, Layout, Privacy Policy URL, Cookie Name, Cookie Expiry, Consent Version
AppearanceColors (BG, text, buttons), Logo, Button Mode, Border Radius, Animation, Theme Preset, Custom CSS
CategoriesAdd/edit categories, multilingual names + descriptions, Required flag, GCM parameter mapping
TextsBanner title, description, button labels — all in 12 languages
Consent ModeEnable GCM v2, Wait for Update timeout, Ads Data Redaction, URL Passthrough
Script BlockingEnable/Disable, Auto-blocking via output buffer
AdvancedLanguage mode, Analytics toggle, Data Retention Days, Export/Import Settings
PremiumLicense Key, Cross-Domain Sync, Cookie Domain, Allowed Subdomains, Embed Code
Settings — General Tab
Replace with: screenshot of Cookie Banner Pro → Settings → General
Settings — Appearance Tab
Replace with: screenshot of Appearance tab with color pickers
Settings — Categories Tab
Replace with: screenshot of Categories tab with GCM mapping

Cookie Banner Pro fully supports Google Consent Mode v2. The plugin injects a consent default script at priority 1 in <head> — before GTM or gtag.js loads.

Default State

gtag('consent', 'default', {
  'analytics_storage': 'denied',
  'ad_storage': 'denied',
  'ad_user_data': 'denied',
  'ad_personalization': 'denied',
  'functionality_storage': 'denied',
  'personalization_storage': 'denied',
  'security_storage': 'granted'
});

Consent Update Flow

  1. User interacts with banner (Accept All / Reject All / Save Preferences)
  2. Plugin calls gtag('consent', 'update', {...}) with the user's choices
  3. A cbp_consent_update event is pushed to the dataLayer
  4. A custom cbp:consent event is dispatched on document
Settings — Consent Mode Tab
Replace with: screenshot of Consent Mode settings

Cookie Format

{
  "v": 1,
  "cats": {
    "necessary": true,
    "analytics": false,
    "marketing": true
  },
  "ts": 1708934400000
}

GTM Template Export

The plugin dynamically generates a GTM container JSON based on your configuration:

  • A "Cookie Banner Pro" folder grouping all elements
  • Main trigger on cbp_consent_update Custom Event
  • Per-category triggers (e.g., "CBP — Analytics Granted")
  • Data Layer variables for each GCM parameter

Import Workflow

  1. Navigate to Cookie Banner → GTM Template in WP Admin
  2. Click Download GTM Container
  3. Open Google Tag Manager → Admin → Import Container
  4. Upload the JSON, choose Merge → Rename
  5. Publish your GTM workspace
GTM Template Export Page
Replace with: screenshot of GTM Template download page in WP Admin
Google Tag Manager — Import Container
Replace with: screenshot of GTM import dialog with the JSON uploaded

Cookie Scanner

The hybrid cookie detection system combines two approaches:

  • Server-side scan: Parses HTTP response Set-Cookie headers
  • Client-side scan: Injected script reads document.cookie for 5 minutes

The built-in database recognizes 30+ cookies from Google Analytics, Facebook Pixel, YouTube, Hotjar, HubSpot, WordPress, and WooCommerce with wildcard pattern matching.

Cookie Scanner — Results View
Replace with: screenshot of Cookie Scanner page with detected cookies

Analytics Dashboard

  • Summary cards: Accept count, Reject count, Acceptance rate
  • Trend graph: Daily accept vs reject vs save over selected period
  • Category breakdown: Pie chart of category acceptance rates
  • Data retention: Configurable auto-cleanup (GDPR data minimization)
Analytics Dashboard — Consent Trends
Replace with: screenshot of Analytics page with trend graph and summary cards

Cross-Domain Sync Premium

Synchronize consent between your WordPress main domain and non-WordPress subdomains.

How It Works

  1. Banner sets cookie with domain=.parent-domain.com
  2. Sync JS is served via REST endpoint /cbp/v1/sync.js?token=XXX
  3. Subdomains embed the sync script in <head> before GTM
  4. Script reads parent cookie, initializes GCM, fires cbp_consent_update

Setup

  1. Activate premium license in Cookie Banner → Premium
  2. Enable Cross-domain Sync
  3. Set Cookie Domain: .yourdomain.com (with dot prefix)
  4. List allowed subdomains (supports wildcards: *.yourdomain.com)
  5. Copy embed code and paste in <head> of each subdomain
Settings — Premium / Cross-Domain Sync
Replace with: screenshot of Premium tab with Cross-Domain Sync settings
Token-gated endpoint with hash_equals() comparison. Config changes propagate with ~5 minute cache delay.

REST API

RouteMethodAuthPurpose
/cbp/v1/consentPOSTPublic (5/min)Log consent decision
/cbp/v1/analyticsGETAdminFetch analytics data
/cbp/v1/licenseGETAdminLicense info
/cbp/v1/scanner/scanPOSTAdminTrigger server-side scan
/cbp/v1/scanner/reportPOSTAdminSubmit client-side results
/cbp/v1/scanner/cookiesGETAdminList known cookies
/cbp/v1/sync.jsGETTokenSync script for subdomains

MarketBridge

WooCommerce Multi-Marketplace Distribution

SaaS

Overview

MarketBridge lets you sell WooCommerce products across 50+ European marketplaces — Amazon, Allegro, eBay, Kaufland, Zalando, and more — from a single WordPress dashboard. It replaces expensive SaaS tools like BaseLinker and ChannelEngine.

MarketBridge — Dashboard Overview
Replace with: screenshot of the main MarketBridge dashboard widget

50+ Marketplaces

Amazon, Allegro, eBay, Kaufland, Zalando, Fnac, Decathlon, and more across Europe.

Real-time Sync

Stock, price, and order synchronization via Action Scheduler (not WP Cron).

Order Import

Marketplace orders automatically imported back into WooCommerce.

Category Mapping

Map WooCommerce categories to marketplace-specific category trees.

Features & Channels

Supported Channel Types

TypeMarketplaces
REST APIAmazon, Allegro, eBay
MiraklFnac, Decathlon, MediaMarkt, and others
ZFSZalando
Channel Settings — Allegro Connection
Replace with: screenshot of Allegro channel configuration

Architecture

Each marketplace implements a ChannelInterface for extensibility. The plugin uses PSR-4 autoloading under the WMM\ namespace.

includes/
├── Core/         Plugin.php, Installer.php, Assets.php
├── Channels/     ChannelRegistry (50 marketplace definitions)
│   ├── Allegro/  (fully implemented)
│   └── GenericChannel.php (placeholder for others)
├── Sync/         SyncManager, PriceSync, StockSync, OrderImport
├── Admin/        SettingsPage, ProductMetaBox, DashboardWidget
└── DB/           ListingsTable, SyncLogTable
Status: Allegro is fully implemented. Remaining 49 channels use GenericChannel placeholder — architecture ready for expansion.
Product Meta Box — Marketplace Listing
Replace with: screenshot of the WooCommerce product edit page with MarketBridge meta box

AI Translator for Polylang

Automatic WordPress translation powered by Claude & ChatGPT

WordPress Plugin

Overview

Automatically translate WordPress posts and pages using Claude (Sonnet 4, Opus 4, Haiku 3.5) or OpenAI (GPT-4, GPT-3.5), fully integrated with the Polylang multilingual plugin.

AI Translator — Post Metabox
Replace with: screenshot of the translation metabox on a post edit page

Features

  • Bulk translation actions from WP admin post list
  • Meta field translation (titles, descriptions, SEO fields)
  • Taxonomy translation (categories, tags)
  • Slug translation (URL-friendly translated slugs)
  • Content chunking for large articles
  • SEO optimization in translations
  • Ajax-powered inline translation in post metabox
Bulk Translation — Post List Action
Replace with: screenshot of WP post list with bulk translate action dropdown

AI Providers

ProviderModels
Anthropic (Claude)Sonnet 4, Opus 4, Haiku 3.5
OpenAIGPT-4, GPT-3.5-turbo
Settings — API Configuration
Replace with: screenshot of Settings page with API key fields and model selection

Architecture

Namespace: AITP\

includes/
├── translation/   ContentParser, ContentChunker, PromptBuilder
│   ├── TranslationManager, TranslationPost
│   ├── MetaTranslator, TaxonomyHandler, SlugTranslator
│   └── SeoTranslator
├── polylang/      PolylangBridge (integration layer)
├── admin/         SettingsPage, PostMetaBox, BulkActions, AjaxHandler
├── api/           AnthropicProvider
└── utils/         Encryption, Logger

Litwa Translate

Modular multilingual solution with AI, Gutenberg blocks & Kadence integration

WordPress Plugin

Overview

A more modular multilingual solution with AI translations, language management, and Kadence theme integration. Includes custom Gutenberg blocks for language-specific content.

Litwa Translate — Dashboard
Replace with: screenshot of the Litwa Translate admin dashboard

Key Differences from AI Translator

  • Requires PHP 8.0+ (vs 7.4+ for AI Translator)
  • Custom Gutenberg blocks for language-specific content
  • Native Kadence theme integration
  • Separate language manager and translation queue system
  • More modular architecture with isolated concerns

Architecture

Namespace: LitwaTranslate\

includes/
├── core/          LanguageManager, TranslationQueue
├── api/           AnthropicProvider, OpenAiProvider
├── admin/         Settings, Dashboard
├── blocks/        Custom Gutenberg blocks
└── integration/   Kadence theme integration
Gutenberg Block — Language-Specific Content
Replace with: screenshot of the Gutenberg editor with Litwa Translate block

WP Direct GA4

Lightweight GA4 tracking via Measurement Protocol

Free Plugin

Overview

WP Direct GA4 is a lightweight alternative to GTM Server-Side that costs $0, uses only 2KB JS (vs 90KB for gtag.js), and requires only 2 config fields: Measurement ID and API Secret.

Settings — Measurement ID & API Secret
Replace with: screenshot of the main settings page with two config fields

2KB Frontend

Ultra-lightweight tracker. Zero JS for page_view events (server-side).

WooCommerce

Full e-commerce auto-tracking from view_item through purchase to refund.

Consent Mode v2

Supports CookieBot, Complianz, CookieYes, Real Cookie Banner.

Debug Panel

Built-in event log inspector in WP admin for troubleshooting.

Events Reference

Server-side Events (zero JS)

EventTrigger
page_viewEvery page load
loginUser login
sign_upUser registration
searchWordPress search query

Frontend Events (2KB JS)

EventDetails
scrollAt 25%, 50%, 75%, 90% thresholds
click (outbound)External link clicks
file_downloadCommon file extensions
user_engagementActive time on page

WooCommerce Tracking

All WooCommerce events are tracked server-side — no additional JS required.

EventDescription
view_itemProduct page view
view_item_listCategory/archive page
add_to_cartProduct added to cart
remove_from_cartProduct removed from cart
view_cartCart page view
begin_checkoutCheckout initiated
add_shipping_infoShipping method selected
add_payment_infoPayment method entered
purchaseOrder completed (with items, revenue, tax, shipping, coupons)
refundFull or partial refund
GA4 DebugView — Events Coming Through
Replace with: screenshot of GA4 DebugView showing events from WP Direct GA4

Queue Strategies

Events are sent asynchronously to GA4 using one of three strategies:

  1. Shutdown hook — fires after response is sent to browser
  2. WP Cron — batches events for deferred sending
  3. Action Scheduler — reliable async processing (recommended)
Debug Panel — Event Log
Replace with: screenshot of the WP admin debug panel with event log

WP Pixel Hub

Universal multi-platform server-side tracking hub

Plugin

Overview

WP Pixel Hub connects 10 tracking platforms from a single dashboard. Same ultra-lightweight 2KB JS, same WooCommerce auto-tracking, but events are broadcast to all enabled providers simultaneously.

Pixel Hub — Provider Dashboard
Replace with: screenshot of the main dashboard with provider toggle switches
Developer API: Use do_action('wpph_track_event', 'event_name', [...]) to send custom events to all active providers.

Providers

ProviderProtocolStatus
Google Analytics 4Measurement ProtocolReady
Facebook / MetaConversions API (CAPI)Ready
TikTokEvents APIReady
PinterestConversions APIReady
LinkedInConversions APIReady
SnapchatCAPIReady
Bing / Microsoft UETServer eventsReady
Twitter / XConversions APIReady
Google AdsConversion trackingReady
Provider Configuration — Facebook CAPI
Replace with: screenshot of a provider settings page (e.g., Facebook CAPI config)

Architecture

Each provider implements the ProviderInterface contract. Events flow through an EventBus that broadcasts to all active providers:

Event Collector → Event Bus → [Provider 1, Provider 2, ...]
                           ↓
                    Queue Manager (per-provider async sending)
Debug Panel — Outgoing Requests
Replace with: screenshot of the real-time debug panel with outgoing request inspection

First-Party Data Proxy

PHP proxy for first-party tracking — bypass ad blockers, preserve cookies

Self-hosted

Overview

A universal PHP proxy (proxy.php) that serves third-party tracking pixels and scripts through your own domain. From the browser's perspective, all requests appear first-party — preserving cookie access and bypassing ad blockers.

Standard:     Browser → facebook.com/tr → blocked by adblocker ✗
With proxy:   Browser → t.yourdomain.com/proxy.php → facebook.com/tr ✓

Supported Services (15+)

Facebook / Meta

Pixel (GET) and Events API (POST)

Google Tag Manager

JS loader and noscript iframe

Google Analytics 4

Script and collect endpoint

TikTok, LinkedIn, Pinterest

Pixel scripts and event collection

Snapchat, Twitter/X, Bing

Conversion tracking pixels

Clarity, Hotjar

Analytics script loaders

Setup & Deployment

What You Need to Deliver

StepActionDetails
1Create subdomaine.g., t.yourdomain.com with HTTPS (Let's Encrypt)
2Upload proxy.phpSingle file to /public_html/proxy.php
3Configure .htaccessOptional — clean URLs + security rules
4Update tracking codesPoint your scripts/pixels to the proxy URL
5Test & verifyDevTools → Network tab + platform debug views
Requirements: PHP 7.4+ with cURL extension. Zero dependencies — single file deployment.
DevTools — Network Tab Showing Proxied Requests
Replace with: screenshot of browser DevTools showing requests going through t.yourdomain.com

Verification Checklist

  1. Visit https://t.yourdomain.com/proxy.php — should show JSON with route list
  2. Test ?_route=fb-pixel&id=123 — should return transparent GIF (status 200)
  3. Test ?_route=gtm-js&id=GTM-XXXX — should return JavaScript
  4. Open DevTools → Network tab — requests should hit t.yourdomain.com
  5. Verify in Facebook Events Manager / GA4 DebugView

Routes Reference

RouteServiceTypeUpstream URL
fb-pixelFacebook Pixelpixelfacebook.com/tr
fb-eventsFacebook Events APIdatagraph.facebook.com
gtm-jsGTM JS Loaderscriptgoogletagmanager.com/gtm.js
gtm-nsGTM Noscriptpixelgoogletagmanager.com/ns.html
ga4-jsGA4 Scriptscriptgoogletagmanager.com/gtag/js
ga4-collectGA4 Collectdatagoogle-analytics.com/g/collect
gadsGoogle Adspixelgoogleadservices.com/pagead
tiktok-jsTikTok Scriptscriptanalytics.tiktok.com
tiktok-collectTikTok Eventsdataanalytics.tiktok.com/api/v2
li-pixelLinkedIn Insightpixelpx.ads.linkedin.com
pin-pixelPinterest Tagpixelct.pinterest.com
snap-pixelSnapchat Pixelpixeltr.snapchat.com
tw-pixelTwitter/X Pixelpixelt.co
clarity-jsMicrosoft Clarityscriptclarity.ms
hotjar-jsHotjarscriptstatic.hotjar.com
bingBing UETpixelbat.bing.com

Integration Examples

Facebook Pixel (noscript)

<!-- Before -->
<noscript>
  <img src="https://www.facebook.com/tr?id=111222333&ev=PageView&noscript=1" />
</noscript>

<!-- After -->
<noscript>
  <img src="https://t.yourdomain.com/proxy.php?_route=fb-pixel&id=111222333&ev=PageView&noscript=1" />
</noscript>

Google Tag Manager

// Before
j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;

// After
j.src='https://t.yourdomain.com/proxy.php?_route=gtm-js&id='+i+dl;

Google Analytics 4 (standalone)

<!-- Before -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXX"></script>

<!-- After -->
<script async src="https://t.yourdomain.com/proxy.php?_route=ga4-js&id=G-XXXX"></script>

Debugging

Add ?_debug=1 to any proxy request to see diagnostic info: upstream URL, HTTP code, cURL errors, response headers, and first 500 chars of response body.

GTM First-Party Plugin

WordPress plugin to proxy GTM from your own domain

Architecture Only

Overview

Instead of loading gtm.js from googletagmanager.com, WordPress serves it from your own domain (e.g., /gtm/gtm.js). This bypasses ad blockers, improves cookie lifespan, and eliminates external DNS lookups.

Standard:     Browser → googletagmanager.com → blocked ✗
With plugin:  Browser → yoursite.com/gtm/ → WordPress cache → Google (sync every 15min) ✓

Benefits

  • GTM container served as first-party resource
  • No external DNS lookup for GTM (faster page load)
  • WP Cron syncs container every 15 minutes
  • Built-in dataLayer push (page data, user data, WooCommerce e-commerce)
  • Internal Google URL rewriting
This plugin is currently in the architecture phase — the complete module structure is defined but implementation has not started yet.

Architecture

includes/
├── class-gtm-proxy.php        Serves gtm.js locally
├── class-gtm-rewriter.php     Rewrites internal Google URLs
├── class-gtm-snippet.php      Injects snippet in <head> + <noscript>
├── class-gtm-sync.php         WP Cron synchronization
├── class-datalayer.php        Optional dataLayer push
├── class-gtm-fpd-support.php  Support system
├── class-gtm-fpd-premium.php  Licensing
└── class-gtm-fpd-options.php  Settings management

admin/
├── class-admin-settings.php
└── views/
    ├── settings-page.php
    └── support-page.php

Planned Configuration

SettingDescription
GTM Container IDYour GTM-XXXX identifier
Proxy PathCustom path (default: /gtm/)
Sync Interval5 min / 15 min / 30 min / 1 hour
DataLayer OptionsPage data, User data, WooCommerce events
License KeySupport & premium features