

Settings page — paste your Measurement ID and choose placement.
Analytics Head is a deliberately simple WordPress plugin for Google Analytics. No dashboards, no Google account connection, no feature creep — just the tracking code, placed exactly where you want it.
Why use this plugin?
Unlike heavyweight analytics suites, this plugin does one job well: inject the standard gtag.js snippet into your site.
<head> by default (optional footer placement)This plugin connects to Google Analytics (via Google Tag Manager / gtag.js) to provide website analytics.
You are responsible for informing visitors (for example in your privacy policy) and, where required, obtaining consent. Suggested privacy policy text is also offered under Settings Privacy when the plugin is active.
add_filter( 'pp_google_analytics_head_tracking_ids', function( $ids ) {
// Add a separate destination only — not a second ID for the same Google tag.
$ids[] = 'AW-123456789';
return $ids;
} );
add_filter( 'pp_google_analytics_head_consent_defaults', function( $defaults ) {
$defaults['wait_for_update'] = 2000;
$defaults['region'] = [ 'PL', 'DE', 'US-CA' ];
return $defaults;
} );
Call this from your consent plugin callback or custom banner “Accept” handler. Update all four types that this plugin sets to denied by default:
gtag('consent', 'update', {
analytics_storage: 'granted',
ad_storage: 'granted',
ad_user_data: 'granted',
ad_personalization: 'granted'
});
If you only want basic analytics (not ads), grant analytics and keep ads denied:
gtag('consent', 'update', {
analytics_storage: 'granted',
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied'
});
add_filter( 'pp_google_analytics_head_inline_script', function( $script, $ids ) {
$script .= "gtag('event','page_view');";
return $script;
}, 10, 2 );