51Degrees > Google Analytics tab. Included // by admin.php (active_tab dispatch). The OAuth gauntlet itself runs in // FiftyOneDegreesOauthCallback / FiftyOneDegreesOauthStart on admin_init / // admin_post; this file is presentation only. // ─── Notice channel (shared with start + callback handlers) ───────────── // One-shot notice transient: rendered exactly once, then cleared so a // refresh doesn't replay. Slug maps 1:1 to a key under oauth.notice.* in // languages/oauth-strings.yaml. consume() encapsulates read+delete so the // UI doesn't drift from the start/callback writer semantics. $fiftyonedegrees_notice_slug = class_exists('FiftyOneDegreesOauthNotice') ? FiftyOneDegreesOauthNotice::consume() : ''; if ($fiftyonedegrees_notice_slug !== '' && class_exists('FiftyOneDegreesStrings')) { $css = ($fiftyonedegrees_notice_slug === 'success' || $fiftyonedegrees_notice_slug === 'migration_done') ? 'notice notice-success' : 'notice notice-error'; // Slugs where a Try-again button does not help the admin: // success / migration_done — flow already finished cleanly. // multisite_unsupported / https_required / placeholder_url — // the start handler will re-trip the same gate, so the click // would loop them back to this notice unchanged. $fiftyonedegrees_no_retry = [ 'success' => true, 'migration_done' => true, 'multisite_unsupported' => true, 'https_required' => true, 'placeholder_url' => true, ]; $fiftyonedegrees_retry_html = ''; if (!isset($fiftyonedegrees_no_retry[$fiftyonedegrees_notice_slug]) && !is_multisite() && class_exists('FiftyOneDegreesOauthStart') ) { $fiftyonedegrees_retry_url = wp_nonce_url( admin_url('admin-post.php?action=fiftyonedegrees_oauth_start'), FiftyOneDegreesOauthStart::NONCE_ACTION ); $fiftyonedegrees_retry_html = sprintf( ' %s', esc_url($fiftyonedegrees_retry_url), esc_html__('Try again', 'fiftyonedegrees') ); } printf( '
%s%s
%s
%s
It is required to Set up an account and a website profile at Google Analytics to send 51Degrees Custom Dimensions to Google Analytics. Once Set Up, create a connection between 51Degrees and your Google Analytics account.
Before connecting: access is only authorized for a resource key whose registered domains include this site. In the Configurator, create the resource key with this site's domain added to it — otherwise the Google Analytics connection will be refused.
authenticate(); if ($fiftyonedegrees_ga_client) { // get_ga4_admin_service always returns a configured // instance; auth-error mapping (revoked scope etc.) // lives inside get_analytics_properties_list, which // sets GA_ERROR before re-throwing as needed. $fiftyonedegrees_ga_admin = $fiftyonedegrees_ga_svc->get_ga4_admin_service($fiftyonedegrees_ga_client); $fiftyonedegrees_ga_svc->get_analytics_properties_list($fiftyonedegrees_ga_admin); } } ?>