Has anyone tried the new Google Analytics Data Api (still in beta) for a GA4-Property?
We did this, the way it is recommended in the docs here: https://developers.google.com/analytics/devguides/reporting/data/v1/quickstart-client-libraries
Connection and authorization is working fine, but the values that are responded are way to small. For example it reported activeUsers for last 7 days as 50...but Analyitcs GUI has about 20.000...same as our old UA-Property that runs parallel. And the old reporting Api has the correct numbers...
We did it exactly like the reference example...
client = BetaAnalyticsDataClient()
request = RunReportRequest(
property="properties/{0}".format(self.property),
dimensions=[Dimension(name="defaultChannelGrouping")],
metrics=[Metric(name="activeUsers")],
date_ranges=[DateRange(start_date="7daysAgo", end_date="today")],
)
response = client.run_report(request)
print("Report result:")
for row in response.rows:
print(row.dimension_values[0].value, row.metric_values[0].value)
This gives me:
Organic Search 34
Paid Search 19
Direct 6
Referral 3
Email 1
So "organic" for example should be around 20.000!
Funny thing is even the Query Explorer App (https://ga-dev-tools.web.app/query-explorer/) is showing these low numbers for the GA4-Property...
Any ideas what could be wrong? Thanks!
Related
I am playing around with the Skyscanner API from their webpage in Postman (opens in a new tab, or in the Postman desktop app) and testing the endpoint for browsing flights. This is what the API says in their page:
And this is what I am trying - browsing for flights from Stockholm Arlanda Airport (ARN-sky) to Heathrow (LHR-sky), on the date 22nd July (around 4 days from now) for first leg, and 25th for return, but as you can see, I am not getting any result. The URL I am trying is this.
Any idea what am I doing wrong, and how to fix it?
Please, mind that you present an image regarding an endpoint to Browse Quotes, but you are trying to consume an endpoint to Browse Routes.
Assuming that you actually want to browse routes, I believe the problem may be this:
The endpoint is of the form:
GET /browseroutes/v1.0/{country}/{currency}/{locale}/{originPlace}/{destinationPlace}/{outboundPartialDate}/{inboundPartialDate}
You are writing a URL like:
.../browseroutes/v1.0/FR/eur/en-US/us/ARN-sky/LHR-sky/2021-07-22/2021-07-25?apikey=<api-key>
So it seems that you are actually specifying:
originPlace = us
destinationPlace = ARN-sky
But I think you wanted to define:
originPlace = ARN-sky
destinationPlace = LHR-sky
To solve this, you may remove the /us member, thus writing: http://partners.api.skyscanner.net/apiservices/browseroutes/v1.0/FR/eur/en-US/ARN-sky/LHR-sky/2021-07-22/2021-07-25?apikey=api-key
(Please, replace the api-key value by an actual API key)
This URL already returns a valid 200 OK result :)
I'm working on a TV application and I would like to track what people do on it. So I used Google Measurement Protocole to do so. The page and event tracking is working fine because I can see in real time what's is happening on the Analytics 360 website. Everything was ok until I look at the "User explorer" to pick a random user in order to see what he did previously. I found out that he had a lot of sessions in a very short period. So I ran a test for myself yesterday and the result is the same today. I had only 1 session with multiple events for more than an hour and by paying attention to trigger an event before the 30min of inactivity which is configured by default.
Here are examples of data sent :
ds=qml
v=1
tid=UA-XXX-YYY
cd1=local
cm=tv
cid=123456789 (unique id)
uip=XX.XX.XX.XX
ua=SAMSUNG
ul=en
cd=HomePage
dp=HomePage
dt=home
cs=MY_TV_APP
t=event
ec=MY_TV_APP
ea=click on button
el=HomePage
or
ds=qml
v=1
tid=UA-XXX-YYY
cd1=local
cm=tv
cid=123456789 (unique id)
uip=XX.XX.XX.XX
ua=SAMSUNG
ul=en
cd=HomePage
dp=HomePage
dt=home
cs=MY_TV_APP
t=pageview
Here is a screenshot of my session: here
As you can see, there are 7 sessions instead of 1... I don't understand why my session was splitted into 7 parts. I tried to use "sc=start" and "sc=end", the result is the same.
Has anyone ever encountered this problem before?
I used Google API to get data from google analytics, but the metrics not the same with the web interface of google analytics.
ie: I get data on 2015-03-01 - It return pageviews 79
But on web interface of google analytics, it is 80.
I had searched on some question the same me, but almost them show the way to solve is Sampling level.
I tried to set other Sampling level
DataResource.GaResource.GetRequest request = Service.Data.Ga.Get(profileId, startDate.ToString("yyyy-MM-dd"),
endDate.ToString("yyyy-MM-dd"), string.Join(",", metrics));
if (dimensions != null)
{
request.Dimensions = string.Join(",", dimensions);
}
request.SamplingLevel = DataResource.GaResource.GetRequest.SamplingLevelEnum.HIGHERPRECISION;
request.StartIndex = startIndex;
return request;
after that, the result return the same before, it not change.
So, anyone know this issue?
Simple its sampled data vs. unsampled data which you can read about here: https://support.google.com/analytics/answer/1042498?hl=en
For API work i normally use a web query explorer to verify that my API call's are being sent and responses match to verify the data: https://ga-dev-tools.appspot.com/explorer/
I'm trying to create an app to read company updates, but I have a few queries. Please help...
I'm using LinkedIn api via Oauth authentication in R
Is there anyway to fetch more updates than the restriction (only allow fetch up to 250 updates or updates in the last 20 days whichever comes first) ?
Example code
https://api.linkedin.com/v1/companies/270126/updates?event-type=status-update&count=100&start=0 &oauth2_access_token={access_token}
Once I got the updateKey, I'm trying to fetch the comments and likes but it's returning NO return
Example code
https://api.linkedin.com/v1/companies/270126/updates/key=UPDATE-c270126-5951438751136768000/update-comments?event-type=status-update&oauth2_access_token={access_token}
https://api.linkedin.com/v1/companies/270126/updates/key=UPDATE-c270126-5951438751136768000/likes?event-type=status-update&oauth2_access_token={access_token}
From the company status-update, it's returning FALSE for is-commentable and is-likable? Is that why there are no result from Query 2. If so, is there anyway to change that setting?
'is-commentable' false '/is-commentable'
'is-likable' false '/is-likable'
Any help would be greatly appreciated!!!!
Linkedin developer - Reading Company Shares link
https://developer.linkedin.com/reading-company-shares
Try using the Share and Social Stream end point instead of the Companies end point like this:
https://api.linkedin.com/v1/people/~/network/updates/key=UPDATE-c270126-5951438751136768000/update-comments?oauth2_access_token={access_token}
The documentation is here:
https://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates
Also you can test different Linkedin API calls here:
https://apigee.com/console/linkedin
Hey Guys, i need some help about with a setup of GA in one site.
This site have information from 2 account, 1 for consolidated and another for country. Yesterday I tried to add another ID (third ID) for TI purposes but when I a looked the stats in GA have been lost.
This is the code, it's correct?
var pageTrackerCons = _gat._getTracker("UA-5352676-2");
pageTrackerCons._setDomainName("none");
pageTrackerCons._setAllowLinker(true);
pageTrackerCons._setCustomVar(1,"Login","No",2);
pageTrackerCons._trackPageview();
var pageTrackerPais = _gat._getTracker("UA-5358924-2");
pageTrackerPais._setDomainName("none");
pageTrackerPais._setAllowLinker(true);
pageTrackerPais._setCustomVar(1,"Login","No",2);
pageTrackerPais._trackPageview();
var pageTrackerServ1 = _gat._getTracker("UA-22944815-2");
pageTrackerServ1._setDomainName("none");
pageTrackerServ1._setAllowLinker(true);
pageTrackerServ1._trackPageview();
UA-22944815-2 es de the new ID with the problems, stats for anothers accounts are fine.
Can we use 3 diferents ID in one site? How?
Thanks in advance
Yes, it's totally possible to use 3 trackers on one page and send data to 3 accounts.
Your code looks correct, maybe it's just a delay in reporting. It may happen that data only shows up after a day or two.
You should first confirm that you have 3 GIF requests to the google-analytics.com servers, each which that utmac parameter matching the accounts that you are expecting.
If you have a GIF request with utmac=UA-22944815-2 , then it means data is collected for your new account. Make sure you look at the right profile, and that the profile has no filters.