How to get public google calendars grouped by category? - google-calendar-api

Is it possible to get list of public calendars grouped by category (holidays, sport, other) like at Settings -> Add calendar -> Browse calendar of interest
I've already try to use calendarList endpoint but it is return only chosen calendars.But I need to get all calendars grouped by category.
Also I try to group it according to id, for example, from calendar id epl_6149_%45verton#sports#group.v.calendar.google.com we understand that main group is sport but there is some problem with epl_6149_%45verton. This is English Premier League -> Everton. How can I get it in human understandable form?

Related

Analytics on a web application

We have an web application. Part of web the application is profiles. Profiles have following urls:
/Profile/1
/Profile/2
/Profile/3
We also have Adds. Add's urls are as following:
/Add/1
/Add/2
/Add/3
I need a view of top 20 most viewed profiles and top 20 most viewed add's and how many views they have. It must also be possible to extract those two lists with c#. Can this be achieved with log analytics? Do you need to extract everything your self from application insights and do analytics your self, or how would you achieve this?
I made a little POC. I have added following to AI. The https://gac/url/1 has thousands of id's. Maybe there us 244 views on https://gac/url/1 and 1128 views on https://gac/url/2and so forth.
I noticed that Id is not added to the log. See code below:
public void WritePageView(string name, string id, Uri url)
{
var pageView = new PageViewTelemetry
{
Name = name,
Id = id,
Url = url
};
pageView.Properties.Add("Id", "1");
telemetry.TrackPageView(pageView);
}
What I need is a top 20 (top x) of which https://gac/url is most visited. Something like:
https://gac/url1: 3434
https://gac/url1: 2432
https://gac/url1: 1298
https://gac/url1: 8211
..
If showed in a graph to would be really great.
So it would be something like group by name and Id. But as Id is only pressent in the url how do I extract that?
It's easy to use analytics query for application insights.
Nav to your azure portal -> application insights -> Logs(Analytics), the related info should be in the pageViews table. When you write your query, you can set custom "Time Range" via UI or use where clause.
You can get all the pageViews info by just write "pageViews", screenshot as below:
And you can use Summarize operator and count operator to get the total views count for each page. Sample query code like below:
pageViews
| summarize totalCount = count(url) by url
| order by totalCount desc
The result as below:
If you want to only get the top 2 most views page, use the following code:
pageViews
| summarize totalCount = count(url) by url
| order by totalCount desc
| top 2 by totalCount

Create a segment using a custom event in Google Analytics

I want to create a segment of users which counts something like total [upgrade] events > 50. The upgrade event is a custom category in this case. How can I pass this event through to be used in segmentation?
I have tried using Event Category matches [upgrade], but that only counts players who have done one or more event in this category. I want to segment based on the number of times a user completes an event in this category.
Thanks for any insight you can lend. We're stumped over here!

Players / Teams / Matches / Seasons

I'm trying to figure out the best way to solve this 'problem'
I have 4 Custom Post Types:
Players
Teams
Matches
Seasons
And i want to connect them to each other somehow so that i can query the results in the frontend.
This is how i want them to be connected:
Each Season has many Teams
Each Team has many Players
Each Match has many Teams & Players
My first attempt was to connect these 4 types with the Relationship Field (Advanced Custom Field).
For example, in a Season's edit page there is:
Repeater Field -> Sub Field (relationship), Sub Field (Points), Sub Field (Games Played)
With the above method, I came across many problems while querying in the front end.
What would be the best method to achieve the desired results?
As per me, just prepare a new taxonomy for all these custom post types. This should be a common taxonomy is for all the four types of custom post types. Now you can relate the posts by categories of that taxonomy...Try it once

drupal views dynamic filter

I have a Drupal website where I post tournament results.
I have created a content-type where i write the result for 1 person in the tournament. So the fields are like: Date of tournament, player name, final position.
If 10 people played in the tournament, I create this content for each player.
Now, I would like to create a table with views, to list all the players in the tournament, and the various info, like player name/final position. I can do that pretty easy by adding the fields and sorting criteria in views. But my problem is, what I should do next time we have a tournament. I would like to just use the same view settings, but without having to clone the previous view, just to change the date filter-criteria.
So, I need the user to be able to view tournament page, and then see the results for that specific tournament. Then if the user go to see a different page from another tournament, then only those results will show up.
And I wish to do it in a clean way, where I don't have to clone the view and just change date.
You can achieve this by making a view with a contextual filter. The contextual filter will handle a taxonomy or node reference so that you can use only 1 dynamic view. But in order to make this work, you might want to adjust your content type a little so that it's easier for your view to filter them:
Your current content type has all the information of a contestant/player (Date of tournament, player name, final position), so it would be better to name that content type Contestant.
Then create a new taxonomy or content type: Tournament which will handle the information of a Tournament. Keeping these separated is a better approach.
So let's say you have a taxonomy: Tournament taxonomy with all your tournaments set up. Then you can add this as a term reference field in your content type: Contestant.
(Add a new term reference field: "Tournament" with widget: select list.)
Create your view:
Filter criteria -> Content:Type (=Contestant)
Page settings -> Path: /tournaments/%
Contextual filter -> Content: Has taxonomy term ID
Override title -> %1
For each taxonomy term (Tournament) you have this view now has a page. So when for example you go to http://yourdrupal/tournaments/1 it will filter your view only for that tournament.
I attached an image so that you can see how I configurated my view

How to count (unique) custom values for a metric in Google Analytics?

Trying to figure out "how many users logged-in last month?" on my website using Google Analytics' web-interface (or API).
For each request, I'm sending user id's in a custom variable as the value:
_gaq.push(['_setCustomVar', 2, 'user_id', '#{ current_user ? current_user.id : 0 }']);
How can I get the number of unique user id's for all pageviews within a certain time-range?
Create a custom segment[*] that includes only visitors with your custom var set. Apply the segment and the audience overview tab will display your desired numbers.
[*] Advanced segments->create custom segment -> first dropdown to "include", second to "Custom Variable 2", third "Exactly matching" and the textfield gets the value for logged-in visitors
Sadly not possible in Google Analytics.
But you can do this in Google Data Studio. There you can create Dashboards for Google Analytics and create a new calculated field, like: COUNT(User ID)

Resources