| 开发者 | seainthetrees |
|---|---|
| 更新时间 | 2026年10月20日 17:29 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
product_added_to_cart, checkout_started, and order_completed (with order totals and line items, deduplicated per order).[posthog_flag key="my-flag"]…[/posthog_flag] shortcode to gate content, plus pressed_hog_is_feature_enabled() and pressed_hog_get_feature_flag() template helpers.yoursite.com/phog/…) so analytics requests are first-party and delivered more reliably.window.pressedHog.grantConsent(); or window.pressedHog.denyConsent();
Hooks
pressed_hog_is_active — filter whether the snippet is output for the current request.pressed_hog_init_config — filter the posthog.init() config array./wp-content/plugins/pressed-hog-analytics-for-posthog, or install it via the Plugins screen.phc_), choose tracking and consent options, and send a test event.In PostHog, open Settings → Project. The key starts with phc_ and is safe to expose publicly.
Yes — choose "Self-hosted / custom" as the host and enter your instance URL.
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.
It needs pretty permalinks enabled (Settings → Permalinks). Every tracked event then passes through your server as a lightweight relay to PostHog — fine for most sites, but consider a CDN-level proxy for very high-traffic sites.
Each trackable link appends standard UTM parameters (source, medium, campaign) plus a unique phg_qr id to your destination URL. When someone scans the code and lands on your site, posthog-js captures those parameters on the $pageview event, so you can break scans down by campaign — or by individual QR code — in PostHog. The QR image itself is generated in the visitor's/your browser; the URL is never sent to an external QR service.
They're saved in your WordPress database (the pressed_hog_links option) and listed on the QR Codes page. Use "Download sheet (CSV)" to export every link — label, destination, full tracked URL, UTM values, tracking id, and created date — as a spreadsheet you can open in Excel or Google Sheets.
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.
pressed-hog-analytics-for-posthog to match the WordPress.org plugin slug.