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 + PremiumMarketBridge
Sell WooCommerce products across 50+ European marketplaces from one dashboard.
SaaSAI Translator for Polylang
Automatic WordPress post translation using Claude or ChatGPT with Polylang integration.
PluginLitwa Translate
Modular multilingual solution with AI, Gutenberg blocks, and Kadence theme integration.
PluginWP Direct GA4
Lightweight GA4 via Measurement Protocol. 2KB JS, full WooCommerce, $0 cost.
FreeWP Pixel Hub
Universal server-side tracking hub — GA4, Facebook CAPI, TikTok, Pinterest, LinkedIn & more.
PluginFirst-Party Data Proxy
PHP proxy serving tracking pixels from your domain. Bypasses ad blockers.
Self-hostedGTM First-Party Plugin
WordPress plugin to proxy GTM from your own domain. Architecture phase.
In DevelopmentCookie Banner Pro
GDPR-compliant cookie consent management for WordPress
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.
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
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
- Download the plugin ZIP from your account or WordPress.org
- Go to WordPress Admin → Plugins → Add New → Upload Plugin
- Upload the ZIP file and click Install Now
- Activate the plugin
- Navigate to Cookie Banner → Settings → General
- Check Enable Banner and set your Privacy Policy URL
- Save changes — the banner now appears on your site
Configuration
| Tab | Key Options |
|---|---|
| General | Enable/Disable, Position, Layout, Privacy Policy URL, Cookie Name, Cookie Expiry, Consent Version |
| Appearance | Colors (BG, text, buttons), Logo, Button Mode, Border Radius, Animation, Theme Preset, Custom CSS |
| Categories | Add/edit categories, multilingual names + descriptions, Required flag, GCM parameter mapping |
| Texts | Banner title, description, button labels — all in 12 languages |
| Consent Mode | Enable GCM v2, Wait for Update timeout, Ads Data Redaction, URL Passthrough |
| Script Blocking | Enable/Disable, Auto-blocking via output buffer |
| Advanced | Language mode, Analytics toggle, Data Retention Days, Export/Import Settings |
| Premium | License Key, Cross-Domain Sync, Cookie Domain, Allowed Subdomains, Embed Code |
Google Consent Mode v2
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
- User interacts with banner (Accept All / Reject All / Save Preferences)
- Plugin calls
gtag('consent', 'update', {...})with the user's choices - A
cbp_consent_updateevent is pushed to the dataLayer - A custom
cbp:consentevent is dispatched ondocument
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_updateCustom Event - Per-category triggers (e.g., "CBP — Analytics Granted")
- Data Layer variables for each GCM parameter
Import Workflow
- Navigate to Cookie Banner → GTM Template in WP Admin
- Click Download GTM Container
- Open Google Tag Manager → Admin → Import Container
- Upload the JSON, choose Merge → Rename
- Publish your GTM workspace
Cookie Scanner
The hybrid cookie detection system combines two approaches:
- Server-side scan: Parses HTTP response
Set-Cookieheaders - Client-side scan: Injected script reads
document.cookiefor 5 minutes
The built-in database recognizes 30+ cookies from Google Analytics, Facebook Pixel, YouTube, Hotjar, HubSpot, WordPress, and WooCommerce with wildcard pattern matching.
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)
Cross-Domain Sync Premium
Synchronize consent between your WordPress main domain and non-WordPress subdomains.
How It Works
- Banner sets cookie with
domain=.parent-domain.com - Sync JS is served via REST endpoint
/cbp/v1/sync.js?token=XXX - Subdomains embed the sync script in
<head>before GTM - Script reads parent cookie, initializes GCM, fires
cbp_consent_update
Setup
- Activate premium license in Cookie Banner → Premium
- Enable Cross-domain Sync
- Set Cookie Domain:
.yourdomain.com(with dot prefix) - List allowed subdomains (supports wildcards:
*.yourdomain.com) - Copy embed code and paste in
<head>of each subdomain
hash_equals() comparison. Config changes propagate with ~5 minute cache delay.REST API
| Route | Method | Auth | Purpose |
|---|---|---|---|
/cbp/v1/consent | POST | Public (5/min) | Log consent decision |
/cbp/v1/analytics | GET | Admin | Fetch analytics data |
/cbp/v1/license | GET | Admin | License info |
/cbp/v1/scanner/scan | POST | Admin | Trigger server-side scan |
/cbp/v1/scanner/report | POST | Admin | Submit client-side results |
/cbp/v1/scanner/cookies | GET | Admin | List known cookies |
/cbp/v1/sync.js | GET | Token | Sync script for subdomains |
MarketBridge
WooCommerce Multi-Marketplace Distribution
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.
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
| Type | Marketplaces |
|---|---|
| REST API | Amazon, Allegro, eBay |
| Mirakl | Fnac, Decathlon, MediaMarkt, and others |
| ZFS | Zalando |
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
AI Translator for Polylang
Automatic WordPress translation powered by Claude & ChatGPT
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.
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
AI Providers
| Provider | Models |
|---|---|
| Anthropic (Claude) | Sonnet 4, Opus 4, Haiku 3.5 |
| OpenAI | GPT-4, GPT-3.5-turbo |
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
Overview
A more modular multilingual solution with AI translations, language management, and Kadence theme integration. Includes custom Gutenberg blocks for language-specific content.
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
WP Direct GA4
Lightweight GA4 tracking via Measurement Protocol
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.
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)
| Event | Trigger |
|---|---|
page_view | Every page load |
login | User login |
sign_up | User registration |
search | WordPress search query |
Frontend Events (2KB JS)
| Event | Details |
|---|---|
scroll | At 25%, 50%, 75%, 90% thresholds |
click (outbound) | External link clicks |
file_download | Common file extensions |
user_engagement | Active time on page |
WooCommerce Tracking
All WooCommerce events are tracked server-side — no additional JS required.
| Event | Description |
|---|---|
view_item | Product page view |
view_item_list | Category/archive page |
add_to_cart | Product added to cart |
remove_from_cart | Product removed from cart |
view_cart | Cart page view |
begin_checkout | Checkout initiated |
add_shipping_info | Shipping method selected |
add_payment_info | Payment method entered |
purchase | Order completed (with items, revenue, tax, shipping, coupons) |
refund | Full or partial refund |
Queue Strategies
Events are sent asynchronously to GA4 using one of three strategies:
- Shutdown hook — fires after response is sent to browser
- WP Cron — batches events for deferred sending
- Action Scheduler — reliable async processing (recommended)
WP Pixel Hub
Universal multi-platform server-side tracking hub
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.
do_action('wpph_track_event', 'event_name', [...]) to send custom events to all active providers.Providers
| Provider | Protocol | Status |
|---|---|---|
| Google Analytics 4 | Measurement Protocol | Ready |
| Facebook / Meta | Conversions API (CAPI) | Ready |
| TikTok | Events API | Ready |
| Conversions API | Ready | |
| Conversions API | Ready | |
| Snapchat | CAPI | Ready |
| Bing / Microsoft UET | Server events | Ready |
| Twitter / X | Conversions API | Ready |
| Google Ads | Conversion tracking | Ready |
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)
First-Party Data Proxy
PHP proxy for first-party tracking — bypass ad blockers, preserve cookies
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
| Step | Action | Details |
|---|---|---|
| 1 | Create subdomain | e.g., t.yourdomain.com with HTTPS (Let's Encrypt) |
| 2 | Upload proxy.php | Single file to /public_html/proxy.php |
| 3 | Configure .htaccess | Optional — clean URLs + security rules |
| 4 | Update tracking codes | Point your scripts/pixels to the proxy URL |
| 5 | Test & verify | DevTools → Network tab + platform debug views |
Verification Checklist
- Visit
https://t.yourdomain.com/proxy.php— should show JSON with route list - Test
?_route=fb-pixel&id=123— should return transparent GIF (status 200) - Test
?_route=gtm-js&id=GTM-XXXX— should return JavaScript - Open DevTools → Network tab — requests should hit
t.yourdomain.com - Verify in Facebook Events Manager / GA4 DebugView
Routes Reference
| Route | Service | Type | Upstream URL |
|---|---|---|---|
fb-pixel | Facebook Pixel | pixel | facebook.com/tr |
fb-events | Facebook Events API | data | graph.facebook.com |
gtm-js | GTM JS Loader | script | googletagmanager.com/gtm.js |
gtm-ns | GTM Noscript | pixel | googletagmanager.com/ns.html |
ga4-js | GA4 Script | script | googletagmanager.com/gtag/js |
ga4-collect | GA4 Collect | data | google-analytics.com/g/collect |
gads | Google Ads | pixel | googleadservices.com/pagead |
tiktok-js | TikTok Script | script | analytics.tiktok.com |
tiktok-collect | TikTok Events | data | analytics.tiktok.com/api/v2 |
li-pixel | LinkedIn Insight | pixel | px.ads.linkedin.com |
pin-pixel | Pinterest Tag | pixel | ct.pinterest.com |
snap-pixel | Snapchat Pixel | pixel | tr.snapchat.com |
tw-pixel | Twitter/X Pixel | pixel | t.co |
clarity-js | Microsoft Clarity | script | clarity.ms |
hotjar-js | Hotjar | script | static.hotjar.com |
bing | Bing UET | pixel | bat.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
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
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
| Setting | Description |
|---|---|
| GTM Container ID | Your GTM-XXXX identifier |
| Proxy Path | Custom path (default: /gtm/) |
| Sync Interval | 5 min / 15 min / 30 min / 1 hour |
| DataLayer Options | Page data, User data, WooCommerce events |
| License Key | Support & premium features |