Add custom dimension to existing Google Analytics page view (using API)

I’ve had a tracking code set up on a WordPress site and have been passing the WP user ID through to GA as a custom dimension. Last week I added a new dimension for the ID of the organisation that the users work for, but obviously this isn’t present for the preceding page views collected by GA.

I’m building some custom analytics pages and need to query the GA API to find out views per organisation. I’ve tried adding the user IDs from the organisation as an array but it exceeds the character limit for filters and segments.

Read More

Is there a way I can loop through the existing page views, match up the organisation based on the user ID from that view, then inject the organisation ID to go with it?

Related posts

1 comment

  1. Joe, I think you need to use the Data Import facility of Google Analytics. You’re already half way there with the user ID in a custom dimension, all you need to do is upload what organisation relates to which ID.

    There’s a few options depending on your current setup so your best bet is to read the docs here: https://support.google.com/analytics/answer/3191589?hl=en

    See the Extended Data Import > User Data part.

Comments are closed.