{"id":378363,"date":"2026-10-20T09:29:52","date_gmt":"2026-10-20T09:29:52","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/pressed-hog-analytics-for-posthog\/"},"modified":"2026-10-20T09:29:30","modified_gmt":"2026-10-20T09:29:30","slug":"pressed-hog-analytics-for-posthog","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/pressed-hog-analytics-for-posthog\/","author":23576959,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"0.3.2","stable_tag":"0.3.2","tested":"7.1.3","requires":"6.0","requires_php":"7.4","requires_plugins":null,"header_name":"Pressed Hog \u2013 Analytics for PostHog","header_author":"sea","header_description":"Connect WordPress to PostHog: analytics snippet, user identification, WooCommerce events, feature flags, and cookie consent.","assets_banners_color":"000000","last_updated":"2026-10-20 09:29:30","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/github.com\/ookpassant\/pressed-hog","header_author_uri":"","rating":0,"author_block_rating":0,"active_installs":0,"downloads":44,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"0.3.2":{"tag":"0.3.2","author":"seainthetrees","date":"2026-10-20 09:29:30","revision":3756294}},"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3756294,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3756294,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3756294,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3756294,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.3.2"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3756294,"resolution":"1","location":"assets","locale":"","width":1280,"height":900},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3756294,"resolution":"2","location":"assets","locale":"","width":1280,"height":900},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3756294,"resolution":"3","location":"assets","locale":"","width":1280,"height":900},"screenshot-4.png":{"filename":"screenshot-4.png","revision":3756294,"resolution":"4","location":"assets","locale":"","width":1280,"height":2264},"screenshot-5.png":{"filename":"screenshot-5.png","revision":3756294,"resolution":"5","location":"assets","locale":"","width":1280,"height":1097},"screenshot-6.png":{"filename":"screenshot-6.png","revision":3756294,"resolution":"6","location":"assets","locale":"","width":1280,"height":800}},"screenshots":{"1":"Setup wizard: connect your PostHog project and validate the API key.","2":"Setup wizard: choose what to track.","3":"Setup wizard: choose how cookie consent is handled.","4":"The settings page.","5":"In-dashboard analytics with traffic chart, top pages, referrers, and devices.","6":"The built-in cookie consent banner."}},"plugin_section":[262246],"plugin_tags":[232,16626,163165,214764,286],"plugin_category":[36,45],"plugin_contributors":[287661],"plugin_business_model":[],"class_list":["post-378363","plugin","type-plugin","status-publish","hentry","plugin_section-dashboard-widgets","plugin_tags-analytics","plugin_tags-cookie-consent","plugin_tags-feature-flags","plugin_tags-posthog","plugin_tags-woocommerce","plugin_category-analytics","plugin_category-ecommerce","plugin_contributors-seainthetrees","plugin_committers-seainthetrees"],"banners":{"banner":"https:\/\/ps.w.org\/pressed-hog-analytics-for-posthog\/assets\/banner-772x250.png?rev=3756294","banner_2x":"https:\/\/ps.w.org\/pressed-hog-analytics-for-posthog\/assets\/banner-1544x500.png?rev=3756294","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/pressed-hog-analytics-for-posthog\/assets\/icon-128x128.png?rev=3756294","icon_2x":"https:\/\/ps.w.org\/pressed-hog-analytics-for-posthog\/assets\/icon-256x256.png?rev=3756294","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/pressed-hog-analytics-for-posthog\/assets\/screenshot-1.png?rev=3756294","caption":"Setup wizard: connect your PostHog project and validate the API key."},{"src":"https:\/\/ps.w.org\/pressed-hog-analytics-for-posthog\/assets\/screenshot-2.png?rev=3756294","caption":"Setup wizard: choose what to track."},{"src":"https:\/\/ps.w.org\/pressed-hog-analytics-for-posthog\/assets\/screenshot-3.png?rev=3756294","caption":"Setup wizard: choose how cookie consent is handled."},{"src":"https:\/\/ps.w.org\/pressed-hog-analytics-for-posthog\/assets\/screenshot-4.png?rev=3756294","caption":"The settings page."},{"src":"https:\/\/ps.w.org\/pressed-hog-analytics-for-posthog\/assets\/screenshot-5.png?rev=3756294","caption":"In-dashboard analytics with traffic chart, top pages, referrers, and devices."},{"src":"https:\/\/ps.w.org\/pressed-hog-analytics-for-posthog\/assets\/screenshot-6.png?rev=3756294","caption":"The built-in cookie consent banner."}],"raw_content":"<!--section=description-->\n<p>Pressed Hog installs <a href=\"https:\/\/posthog.com\">PostHog<\/a> product analytics on your WordPress site \u2014 no code required. Works with PostHog Cloud (US or EU) and self-hosted PostHog instances.<\/p>\n\n<p><strong>Features<\/strong><\/p>\n\n<ul>\n<li>Guided setup wizard on activation: pick your region, validate your API key live against your PostHog host, choose tracking and consent options, and send a test event to confirm everything works end to end.<\/li>\n<li>Injects the official posthog-js snippet with your project API key and host.<\/li>\n<li>Toggles for pageview capture, autocapture, session replay, and popover surveys.<\/li>\n<li>Optionally identify logged-in users, linking events to their WordPress account.<\/li>\n<li>Exclude roles (administrators, editors, \u2026) from tracking so your own clicks stay out of your data.<\/li>\n<li>Consent handling with three modes: no gate, a built-in cookie banner, or integration with an external consent plugin via a cookie or JavaScript API.<\/li>\n<li>WooCommerce events: <code>product_added_to_cart<\/code>, <code>checkout_started<\/code>, and <code>order_completed<\/code> (with order totals and line items, deduplicated per order).<\/li>\n<li>Server-side feature flags: a <code>[posthog_flag key=\"my-flag\"]\u2026[\/posthog_flag]<\/code> shortcode to gate content, plus <code>pressed_hog_is_feature_enabled()<\/code> and <code>pressed_hog_get_feature_flag()<\/code> template helpers.<\/li>\n<li>Reverse proxy: serve PostHog through your own domain (e.g. <code>yoursite.com\/phog\/\u2026<\/code>) so analytics requests are first-party and delivered more reliably.<\/li>\n<li>In-dashboard analytics: a Pressed Hog admin page with pageviews, unique visitors, a traffic chart, top pages, referrers, and devices \u2014 plus a WordPress dashboard widget and an optional link to a PostHog shared dashboard. Requires a personal API key with read-only Query scope.<\/li>\n<li>QR codes &amp; trackable links: turn any URL of your own into a campaign-tagged link (UTM parameters plus a unique per-link id so PostHog can attribute each QR individually), generate its QR code right in the browser (nothing is sent to a third-party QR service), keep a saved list of your links, and export the whole list as a downloadable CSV spreadsheet. Download each QR as PNG or SVG.<\/li>\n<\/ul>\n\n<p><strong>Consent integration for developers<\/strong><\/p>\n\n<p>In \"external\" consent mode, tracking stays off until either the configured cookie equals the configured value, or your consent plugin calls:<\/p>\n\n<pre><code>window.pressedHog.grantConsent(); or `window.pressedHog.denyConsent();`\n<\/code><\/pre>\n\n<p><strong>Hooks<\/strong><\/p>\n\n<ul>\n<li><code>pressed_hog_is_active<\/code> \u2014 filter whether the snippet is output for the current request.<\/li>\n<li><code>pressed_hog_init_config<\/code> \u2014 filter the <code>posthog.init()<\/code> config array.<\/li>\n<\/ul>\n\n<p>PostHog is a registered trademark of PostHog, Inc. This plugin is an independent integration and is not affiliated with or endorsed by PostHog, Inc.<\/p>\n\n<h3>External services<\/h3>\n\n<p>This plugin connects your site to <a href=\"https:\/\/posthog.com\">PostHog<\/a>, a product analytics service. Nothing is sent anywhere until you enter a PostHog project API key. Depending on the features you enable, data goes to PostHog Cloud US (<code>us.posthog.com<\/code>, <code>us.i.posthog.com<\/code>, <code>us-assets.i.posthog.com<\/code>), PostHog Cloud EU (<code>eu.posthog.com<\/code>, <code>eu.i.posthog.com<\/code>, <code>eu-assets.i.posthog.com<\/code>), or the self-hosted PostHog instance you configure.<\/p>\n\n<ul>\n<li><strong>Tracking library (visitors' browsers).<\/strong> On every front-end page view by a tracked visitor, the browser loads the posthog-js library from PostHog's asset host. It then sends the events you enabled: pageviews (URL, referrer, browser, device, screen size), autocaptured clicks and form submissions, session recordings, and survey responses, together with an anonymous ID and the visitor's IP address. When a consent mode is enabled, nothing is captured and no PostHog cookie is stored until the visitor consents.<\/li>\n<li><strong>User identification (optional).<\/strong> If \"Identify logged-in users\" is on, the logged-in user's WordPress user ID, email address, and display name are sent to PostHog.<\/li>\n<li><strong>WooCommerce events (optional).<\/strong> If enabled, add-to-cart, checkout-started, and order-completed events are sent, including product IDs, product names, quantities, order totals, and currency.<\/li>\n<li><strong>Reverse proxy (optional).<\/strong> If enabled, visitors' tracking requests pass through your server to PostHog, with the visitor's IP address forwarded in the <code>X-Forwarded-For<\/code> header. The posthog-js library files are still loaded from PostHog's asset host.<\/li>\n<li><strong>Feature flags (server-side).<\/strong> When a page uses the <code>[posthog_flag]<\/code> shortcode or the flag helper functions, your server sends your project API key and the visitor's PostHog ID (or WordPress user ID for logged-in users) to PostHog's <code>\/decide<\/code> endpoint. Results are cached for 60 seconds.<\/li>\n<li><strong>Setup wizard.<\/strong> When you validate your key or send a test event, your server sends the project API key, and for the test event your user ID, site URL, and plugin version, to PostHog.<\/li>\n<li><strong>In-dashboard analytics (optional).<\/strong> When an administrator opens the analytics page or dashboard widget, your server sends read-only queries to PostHog's Query API using your personal API key and project ID. Results are cached for 5 minutes.<\/li>\n<\/ul>\n\n<p>PostHog's terms of service: https:\/\/posthog.com\/terms\nPostHog's privacy policy: https:\/\/posthog.com\/privacy<\/p>\n\n<p>If you self-host PostHog, the data goes only to your own instance, and your own terms and privacy policy apply.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the plugin to <code>\/wp-content\/plugins\/pressed-hog-analytics-for-posthog<\/code>, or install it via the Plugins screen.<\/li>\n<li>Activate it \u2014 you'll be taken straight to the setup wizard.<\/li>\n<li>Follow the wizard: pick your PostHog region, paste your project API key (starts with <code>phc_<\/code>), choose tracking and consent options, and send a test event.<\/li>\n<\/ol>\n\n<p>You can re-run the wizard any time from the \"Setup wizard\" link on the Plugins screen, or manage everything on Settings \u2192 Pressed Hog.<\/p>\n\n<!--section=faq-->\n<dl>\n<dt id=\"where%20do%20i%20find%20my%20project%20api%20key%3F\"><h3>Where do I find my project API key?<\/h3><\/dt>\n<dd><p>In PostHog, open Settings \u2192 Project. The key starts with <code>phc_<\/code> and is safe to expose publicly.<\/p><\/dd>\n<dt id=\"does%20this%20work%20with%20self-hosted%20posthog%3F\"><h3>Does this work with self-hosted PostHog?<\/h3><\/dt>\n<dd><p>Yes \u2014 choose \"Self-hosted \/ custom\" as the host and enter your instance URL.<\/p><\/dd>\n<dt id=\"does%20the%20plugin%20send%20any%20data%20to%20posthog%20on%20its%20own%3F\"><h3>Does the plugin send any data to PostHog on its own?<\/h3><\/dt>\n<dd><p>Only what you enable. The tracking snippet runs in visitors' browsers; the only server-side request is feature flag evaluation (when you use the shortcode or helpers), sent to your configured PostHog host.<\/p><\/dd>\n<dt id=\"does%20the%20reverse%20proxy%20work%20on%20any%20host%3F\"><h3>Does the reverse proxy work on any host?<\/h3><\/dt>\n<dd><p>It needs pretty permalinks enabled (Settings \u2192 Permalinks). Every tracked event then passes through your server as a lightweight relay to PostHog \u2014 fine for most sites, but consider a CDN-level proxy for very high-traffic sites.<\/p><\/dd>\n<dt id=\"how%20do%20the%20qr%20codes%20track%20scans%3F\"><h3>How do the QR codes track scans?<\/h3><\/dt>\n<dd><p>Each trackable link appends standard UTM parameters (source, medium, campaign) plus a unique <code>phg_qr<\/code> id to your destination URL. When someone scans the code and lands on your site, posthog-js captures those parameters on the <code>$pageview<\/code> event, so you can break scans down by campaign \u2014 or by individual QR code \u2014 in PostHog. The QR image itself is generated in the visitor's\/your browser; the URL is never sent to an external QR service.<\/p><\/dd>\n<dt id=\"where%20are%20my%20links%20stored%2C%20and%20can%20i%20export%20them%3F\"><h3>Where are my links stored, and can I export them?<\/h3><\/dt>\n<dd><p>They're saved in your WordPress database (the <code>pressed_hog_links<\/code> option) and listed on the QR Codes page. Use \"Download sheet (CSV)\" to export every link \u2014 label, destination, full tracked URL, UTM values, tracking id, and created date \u2014 as a spreadsheet you can open in Excel or Google Sheets.<\/p><\/dd>\n<dt id=\"is%20my%20personal%20api%20key%20safe%3F\"><h3>Is my personal API key safe?<\/h3><\/dt>\n<dd><p>It is stored in its own non-autoloaded WordPress option. Public tracking requests load a separate settings option and do not retrieve the credential. It is only ever used server-side (never printed on the front end). Create it with the read-only Query scope so it can't modify anything.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>0.3.2<\/h4>\n\n<ul>\n<li>The optional PostHog shared dashboard is now linked from the analytics page instead of embedded in an iframe.<\/li>\n<li>The reverse proxy now relays only PostHog's JSON API responses; library files load directly from PostHog's asset host.<\/li>\n<li>Text domain changed to <code>pressed-hog-analytics-for-posthog<\/code> to match the WordPress.org plugin slug.<\/li>\n<li>All admin output is escaped at the point of output.<\/li>\n<li>Fixed a PHP deprecation notice on the setup wizard screen.<\/li>\n<\/ul>\n\n<h4>0.3.1<\/h4>\n\n<ul>\n<li>Renamed to \"Pressed Hog \u2013 Analytics for PostHog\"; the admin menu is now labelled \"Pressed Hog\" and no longer sits at the top of the menu.<\/li>\n<li>The tracking snippet, settings script, and dashboard-widget styles now go through the WordPress script and style loaders instead of inline tags.<\/li>\n<li>With a consent mode on, posthog-js no longer stores cookies or localStorage until the visitor consents.<\/li>\n<li>The \"connect PostHog\" reminder now appears only on the Plugins screen.<\/li>\n<li>Uninstall now also removes WooCommerce order meta and cleans up every site on a multisite network.<\/li>\n<li>Documented the external services the plugin uses.<\/li>\n<\/ul>\n\n<h4>0.3.0<\/h4>\n\n<ul>\n<li>New \"QR Codes\" page (under the PostHog menu): create trackable links from your own URLs with UTM tags and a unique tracking id, generate QR codes, save your links, and download the list as a CSV spreadsheet. QR codes are generated entirely in the browser and can be downloaded as PNG or SVG.<\/li>\n<\/ul>\n\n<h4>0.2.1<\/h4>\n\n<ul>\n<li>Security hardening: restrict the reverse proxy to known PostHog paths and methods with a request-body size cap; validate the wizard's key-check host (HTTPS only, via wp_safe_remote_post) to prevent internal-network probing; stop exposing the personal API key in the setup wizard's page HTML and keep it out of the autoloaded options cache; reject numeric anonymous feature-flag identifiers.<\/li>\n<\/ul>\n\n<h4>0.2.0<\/h4>\n\n<ul>\n<li>Reverse proxy for ad-blocker-resistant tracking through your own domain.<\/li>\n<li>In-dashboard analytics page, dashboard widget, and optional embedded shared dashboard.<\/li>\n<\/ul>\n\n<h4>0.1.0<\/h4>\n\n<ul>\n<li>Initial release.<\/li>\n<\/ul>","raw_excerpt":"Connect WordPress to PostHog: analytics, session replay, surveys, user identification, WooCommerce events, feature flags, and cookie consent.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/378363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=378363"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/seainthetrees"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=378363"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=378363"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=378363"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=378363"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=378363"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=378363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}