Integration With Google Analytics

Below are the steps to enable Google Analytics 4 custom dimension tracking with the 51Degrees plugin.

Before you start:

  1. Open the Google Analytics tab and click Connect Google Analytics. You will be redirected to the Google consent screen.

    " alt="GoogleAnalytics1">

  2. Sign in with the Google account that owns the GA4 property and grant the requested permissions. The plugin asks for the analytics.edit scope so it can list your properties and create custom dimensions on your behalf. After you approve, Google redirects you back to the plugin automatically — no codes to copy.

    " alt="GoogleAnalytics2">

  3. Back in the plugin, the Connect button is replaced with a Logout button. Use the Analytics Account/Property drop-down to pick the GA4 property you want to send data to. Click the refresh icon next to the drop-down if your newly-created property does not appear immediately. Optionally check Send Page View (only if no other Google Analytics plugin is already sending page views, to avoid duplication). Click Save Changes.

  4. The plugin opens the Custom Dimensions screen, listing every 51Degrees device property the Resource Key resolves and the GA4 event parameter each one will be sent as. The mappings are pre-populated; adjust any individual parameter name if it would collide with a custom dimension you defined yourself on the property.

    " alt="GoogleAnalytics3">

  5. Click Enable Google Analytics Tracking. The plugin creates the listed custom dimensions in your GA4 property via the GA4 Admin API (display names prefixed with Fifty One Degrees) and begins emitting a fod event with the device-property parameters on every public page load. No further setup is required in the GA4 console.

    " alt="GoogleAnalytics4">

Verifying: open any public page in a fresh incognito window with DevTools Network tab open and filter by collect. You should see one POST /g/collect?...&en=fod&ep.<param>=... request per page load with status 204 No Content. The custom dimensions appear under Admin → Custom definitions in Google Analytics (GA4 may delay listing newly-created dimensions in the console for several minutes — the API call succeeds immediately).

Use in templates and advanced features

Please visit our documentation page for more information on advanced features including Value Replacement and Conditional Blocks.