is there a way to merge properties in Google Analytics? - google-analytics

I wonder if someone has been in similar situation:
I currently have 2 Google Analytics properties.
Native AOS/iOS app that is integrated with Firebase
Website that is integrated with tag manager
As the website was developed later than the app, we ended up creating separate properties on GA, however, now the website will only be available to traffic from inside the app (the website will be shown in a WebView), so it makes sense to merge the all data should be attributed to the users from the App property.
On the website configuration on GTM, I created a base pixel that fires on all pages with the measurement ID of the website. I noticed that there is no measurement id on the app settings peoperty, but a firebase id, so I am not sure how to proceed.
Is the only solution to this case is to integrate the firebase events to the website?

No, you're mixing up data streams with properties. Also, I assume we're talking here about GA4 and not GAUA since you used the term measurement id rather than property id.
Go yo your GA4 property where the firebase traffic is. Go to Admin. Go to the Data Streams under the Property section of the admin panel. You should see there your Firebase streams. Make a new one, for web. Copy Web's measurement id, paste it in GTM's config tag. Good, publish. Now you have your webview tracking flowing into the same property your firebase is flowing to.
There's one caveat to watch out for. The app may not pass your client id and session id into the webview. You may need to ask the devs to pass those in query params or cookies and then remap them properly with GTM. Just to make sure your data is not only in one property, but also makes sense session-wise and user-wise.
As for the old web data, it shouldn't be important. If it's still important to merge old web data with the app data, well, you can't merge it in GA. You will have to merge it down the ETL pipe somewhere. BQ would be a fitting place to merge, but it's up to whoever does the ETL.

Related

GA4 client id issue

We are trying to migrate from Universal Analytics to GA4. The issue we are having is that GA4 requires a client_id field which we cannot get in a desktop application (C++). Is it possible to get client_id without a browser? and without being an IOS or Android app?
Just generate a unique id for each user, that's it. That's exactly what GA does on web. Same applies for GUA. I wonder how you were tracking users without setting client id for UA. Were you tracking them?
Another thing is that despite all the fuss around GA4, it is an unfinished product. Even though Google recommends it, the professionals who actually work with GA's data recommend to either not use it and give it another year or two or implement it very shallowly in parallel with existing tracking just to have some semblance of historical data in it when it's time to switch.
Finally, if you're tracking a desktop app, you likely use the measurement protocol rather directly, so you mind find this useful: https://firebase.google.com/codelabs/firebase_mp#2

New Google Analytics property not capturing traffic

Hell,
We have a production prperty for google analytics and out IOS and Android Apps are recording the events and data.
I am trying to create a test property in order to use it in the test environment, how ever that does not seem to work. here is what I have done:
1. Created a new prperty under the production account
2. Created Streams for Ios, Android and Web
3. Cannot find the Tracking Id for the new property. Sme places I have read it is in the format
UA-AccountId-PrpertySlnumnber. I have tried that but not result.
4. Some places suggested to use the measurementid (G-xxxxxxxx) available in the web Stream and I used that but still it wont work.
However if I use PROD tracking Id in the code, it perfectly works. Am I missing anything? Any guidance will really help.
(Added as answer because low reputation doesn't allow comment)
Can you clarify if this is what is occurring?
Production property with production tracking ID shows data
Test property with test measurementID does not show data
Test property with test tracking ID (tracking ID not found)
Or did you mean Test property with Production tracking ID shows data?
Based on this, it sounds like your properties are not replicates. Are they both the same type of property? I would suggest going through the instructions on Google with both properties side-by-side.
See further info below:
https://www.blog.google/products/marketingplatform/analytics/new-way-unify-app-and-website-measurement-google-analytics/
https://support.google.com/analytics/answer/7372977
https://support.google.com/analytics/answer/9304153
https://support.google.com/analytics/answer/9303323
A couple things to consider.
Have you setup the firebase console correctly?
Are the data being sent out correctly? You can check this in your network calls.
Is there a lot of data being tracked already in your current environment (Staging or dev)? Google analytics perform sampling on the data when there's too much data coming in. I think it's 1 million data points per day. It does 1% sampling on our production app.
I think my mistake was I was trying to create a new google analytics for firebase property but was not connecting it to the firebase.
The reason behind is I was trying to accomodate it with the older Google Analytics SDK implementation and I was not finding any documentation which said no it is mot possible.
Now, I created properties connected them through google firebase projects and enabled analytics with them. In my xamarin app I used Xamarin.Firebase packaged to get it working.

Allowing user access to analytics

I would like to enable (some) of my users to view my website's analytics data.
Our website has a bunch of groups where users can add content. I would like to enable certain users (group admins), to view usage statistics for that specific group. Ofcourse the data should only be accessable to those users with the VIEW_ANALYTICS right, not to any others.
Is there any way to do this in Google Analytics, or is there some other platform I could use to easily achieve this goal (we use AWS for our hosting)?
Regards,
klmdb
The Google Embed API allows you to display analytics data in your own pages. Pages that are only accessible to the members of your VIEW_ANALYTICS group.
You can create a service account and give it the appropriate access in the analytics user management for the property.
You also authorize the service account to use the embed API in the developers API console. (I don't have enough points to include more than two links in an answer.) In the API console you can generate a private key (p12 or json format) which you then use on your server to authenticate the request for analytics data.
You don't say which technologies you are using, but they show Java and Python examples of how to set up the authentication by the Service Account. I've also seen some node.js and php libraries.
This way you don't have to manage who has access through the google anayltics admin system, you just need to control who has access to your "dashboard" page.
I have done this all with client-side javascript and it works. Of course the client-side nature means that anybody who knows how to use browser debug tools can get our private-key, but in our particular case I'm not worried about it. On the other had it seem like you need to keep some security around this so I wouldn't recommend the client-side solution.

Using Google Analytics to show subset of data for customers of web application using embed api

I'm developing an application where each 'business' has its own page (or rather many pages):
For example example.com/business/abc/
So, for the logged in business owners in the system I would like to give a feature 'View page analytics'. It would display how many visits (and maybe a couple of other things) that particular page has had.
Is there a way of doing this using the Google Analytics API with my constraints:
I don't want customers to provide their own UA code
I don't want them to require to have GA account
Customers don't need to have Google email account
I don't want to build the entire frontend and backend myself. I would rather use something existing
I've been researching this topic for hours trying to come up with a solution and can't figure out anything.
Here is what I tried and what problems happened to me:
http://ga-dev-tools.appspot.com/demos/embed-api/
This is basically exactly what I want for my customers to be displayed on my site (like in the examples), except that Embed Api tries to authorize users to their own (owned) google analytics. I want it instead to use my own Google Analytics data (or rather part of it)
The way I thought about limiting data access would be for every one of my customers to create a View in GA, Add filter to that View so only customer pages are listed there, assign User to the view, and use the Embed Api to display data from that View only. There are a couple of problems with that:
To assign User to View we need email address. And this must be either google account email, or account from a project created with Google Developers Console (application).
In other words I can't create (in any way that I know) an account that would be a shield account for my customers to a subset of my GA data that they would be interested in. It must be either a real user or a real application email address.
So what I tried to do is... I created an app in Google Developers Console, Created new OAuth Service Account. Using Ruby code (that in production app would be running on backend) I obtained OAuth token. I added this email of my OAuth service account as a User to the View
I wanted this server side generated oauth token to be used by Embed Api. That would achieve the effect that I generate the token for on my backend and user can use it without having GA user in my GA property. So I changed according to documentation the basic Embed Api example to use
gapi.analytics.auth.authorize({
container: 'auth',
clientid: 'xxx.apps.googleusercontent.com',
serverAuth: {
access_token: 'Server side generated token'
}
});
instead of
gapi.analytics.auth.authorize({
container: 'auth',
clientid: 'xxx.apps.googleusercontent.com',
});
The effects are not quite what I expected. The example doesn't show anymore (I can't see my data) but I can see in Netowrking section in Chrome that it is actually receiving real data from GA. But for unknown reason, nothing is appearing.
What I try to avoid is building a solution in which I need to build server side code that is querying GA for data, providing it to the frontend and then JS is responsible for displaying it. I would rather use Embed API but it seems not to be well suited for the use case where I don't want users to play with their UA data but rather with my own UA data limited to some scope. I would like to have at least the frontend or backend part of the solution solved. The solution doesn't need to be even Google Analytics based. Anything else that would let me achieve the use case easily and let the business owners see the effects of their marketing (traffic, sales) would be interesting as well.
Related:
Using google analytics API to show subset of data for customers of web application
Google analytics customer data?
Google Analytics API: filter by URI?
https://embeddedanalytics.com seems like something that could be useful, but their page and graphs look like from a few years ago. I would like something more pretty.
https://oocharts.com seems to be interesting because of what their docs.oocharts.com says about queries. But they don't charge anything for their product so I am skeptical of their business model and whether it is a good long-term solution. update: dead link
I don't have enough karma to post links ;)
TLDR: Displaying subset of my GA data to my customers without forcing them to become GA users and adding them to my GA account.
Any help appreciated!
Without seeing your code it's hard to know where the problem is, but using the serverAuth option definitely works. And when using the serverAuth option, you don't need to specify a client ID or container, all you need to enter is the following:
gapi.analytics.auth.authorize({
serverAuth: {
access_token: 'Server side generated token'
}
});
Here's an example that will work if you enter in a valid access token and the idsfor a view to which you have access:
http://jsbin.com/vukezoheyeco/3/edit
Note: when doing auth like this, it happens sync. This can be a gotcha if you're used to an async auth flow (like normal) and you add an event handler listening for the "success" event after calling .authorize because then your handler will never run.
I think you need the Google Analytics Super Proxy
You download the github package and upload to your own App Engine project, do some minimal configuration and then you have an interface where you can setup Google Analytics API calls which require no user login.
It provides end user URLs that you can use to construct data tables in your front end, it also provides data-table format so it slots right into Google Charts.
So for example, you have a user that needs access to visits, revenue for site section /sectionA/
You set up the GA super proxy to serve them a URL that only includes data for that section - you can try out queries here in the GA query explorer. In this case, metrics=ga:visits,ga:productRevenue and filter~=ga:page=/sectionA/
This produces an end URL with JSON data, that refreshes daily/hourly - your choice. You import this URL into your app.
The end user then logs in to your app, and sees the chart data generated from the end URL for their login. They don't need to know about GA super proxy, they just see the end resulting chart.
You could get more sophisticated by providing dropdowns to select which data chart they see, which changes the GA super proxy URL that is requested.

Google analytics api

I would like to have a div on my companies website that is filled with links to our most-visited pages dynamically by querying our google analytics account. From everything I've been looking at in the DataExport API though, it seems like the user viewing the site has to authenticate. Am I missing something?
This is correct: google analytics only supplies exported data to an authenticated user (you wouldn't want it otherwise after all, with your competitors peeking at your data, right?-).
You can run the application querying analytics separately, with all required authentication, and have that application supply such data selectively to "your company's website" with whatever level of validation you think is warranted (to avoid snooping competitors) -- if the exact subset of data that you supply (just most-visited pages, for example) is not sensitive according to your judgment, you may in fact get away without the "validation" part!-).
You could add a server side script that grabs your analytics data using the api and write some javascript that inserts it into the div.
There are a number of different client libraries for google analytics you could use.

Resources