Google calendar id length and event id length - google-calendar-api

I try to search the default google calendar ID length and event ID length, but not able to find the information, I need to store the calendar ID and event ID in mysql, so the size is required.
I will not provide my own ID when add events/calendars, I am looking for the ID as :
If you do not specify an ID, it will be automatically generated by the server.
What is the length of such calendar ID and event ID?

Answer:
Calendar IDs are not writable and are generated by the server. Event IDs can be generated as specified in the event creation documentation.
More Information:
As per the documentation on Events: insert:
id string:
Opaque identifier of the event. When creating new single or recurring events, you can specify their IDs. Provided IDs must follow these rules:
characters allowed in the ID are those used in base32hex encoding, i.e. lowercase letters a-v and digits 0-9, see section 3.1.2 in RFC2938
the length of the ID must be between 5 and 1024 characters
the ID must be unique per calendar
Due to the globally distributed nature of the system, we cannot guarantee that ID collisions will be detected at event creation time. To minimize the risk of collisions we recommend using an established UUID algorithm such as one described in RFC4122.
If you do not specify an ID, it will be automatically generated by the server.
Note that the icalUID and the id are not identical and only one of them should be supplied at event creation time. One difference in their semantics is that in recurring events, all occurrences of one event have different ids while they all share the same icalUIDs.
As for the Calender ID, as you can see from the Calendar resource page, the id is not writable.

Related

Create Google Calendar Event with URL and predefined Event Id

I would like to create a Google Calendar event with a URL having a predefined eventId, so that if user want to modify the event later I can redirect him to the Event using predefined eventId stored in database.
You can use the events.insert method as specified there: https://developers.google.com/calendar/v3/reference/events/insert
You can pass a custom Id on the requestBody of your query that you can use later, alongside your calendarId, to edit your event through the update or patch method.
Follow the guidelines when generating your custom Id:
Provided IDs must follow these rules:
characters allowed in the ID are those used in base32hex encoding, i.e. lowercase letters a-v and digits 0-9, see section 3.1.2 in
RFC2938
the length of the ID must be between 5 and 1024 characters
the ID must be unique per calendar
Due to the globally distributed nature of the system, we cannot guarantee that ID collisions will be detected at event creation time.
To minimize the risk of collisions we recommend using an established
UUID algorithm such as one described in RFC4122. -If you do not
specify an ID, it will be automatically generated by the server.

Microsoft Project: Is it now possible to set or change a Unique ID of a task?

In Microsoft Project, the only way to reset Unique IDs in the past was to change all Unique IDs in a file. This is rarely done but possible to do if someone happened to want the schedule to have Unique IDs in ascending order like the Task IDs. Recently, I was asked if it was now possible to set or change the Unique ID of a singular task. I don't believe that you can and I haven't found any documentation from Microsoft that says that this is possible. Does anyone know if you can in fact set or change the Unique ID of a single task?
No. Nothing has changed--the Unique ID is a calculated field which is another way of saying it's unchangeable by the user.
A very quick search leads to the documentation: Unique ID fields which states:
The Unique ID field contains the number that Microsoft Office Project automatically designates whenever a new task, resource, or assignment is created in the current project. This number indicates the sequence in which the task, resource, or assignment was created, regardless of placement in the schedule.
There are several categories of Unique ID fields.
Data Type Integer
Unique ID (task field)
Entry Type Calculated
How Calculated As you create new tasks, Project adds a unique number to each task in the project. This number is unique in that it is never rearranged or reused if the task is moved or deleted.

Google map places service returns both id and place_id for each place. Can I use the id to identify the place?

The Google places service nearbySearch request returns places with both ids and place_ids. Can I use the id field to identify a place? Old posts say that the id field is depreciated, and that I should use the place_id, but I can't find that information in the current documentation.
The reason I'm asking this is the place_id is something that changes from time to time (such as when a restaurant's address changes), so it's not ideal for me to use. I'm looking for a permanent id to identify a restaurant.
Can I use the id field to do this?
The "id" field in Places API result has already been deprecated 4 years ago. In replacement, you'll need to use the "place_id" field moving forward which is the textual identifier that uniquely identifies a place. More info in this doc
This has also been answered in Google's Public Issue Tracker here: https://issuetracker.google.com/issues/134893143
Although the place_id is the unique identifier of a place and is recommended to use, it may change due to certain updates as per this doc. One strategy is to store the original request that returned each place ID. If a place ID becomes invalid, you can re-issue that request to get fresh results.
As of now, the place_id field would be the most recommended unique reference to a specific place.
Hope this helps!
Edit: Below is the deprecation notice that could once be found in the documentation.
Note: The id and reference fields are deprecated as of June 24, 2014. They are replaced by the new place ID, a unique identifier that can be used to compare places and to retrieve information about a place. The Places API currently returns a place_id in all responses, and accepts a placeid in the Place Details and Place Delete requests. Soon after June 24, 2015, the API will stop returning the id and reference fields in responses. Some time later, the API will no longer accept the reference in requests. We recommend that you update your code to use the new place ID instead of id and reference as soon as possible.
They do still return the ID field for some reason, but you should definitely use the place id instead.

Custom metric to track email opens

I am trying to track the number of email opens of a mailing.
This mailing is not personalised, so each receiver will get exactly the same email contents.
So far I have found out that I can add a tracking pixel in the mailing, which will send data to GA that a user opened the mail (images were loaded).
Example code:
<img src=”http://www.google-analytics.com/collect?v=1&tid=UA-XXXXXX-X
&cid=EmailOpenTest&t=event&ec=email&ea=open&el=EmailOpenTest
&cs=newsletter&cm=email&cn=Email&cm1=1″ />
'tid' will be our custom tracking ID.
This all works, as when this link is opened the total number of hits increases.
But my question relates to parameter 'cid'. For testing purposes, I have set this here to "EmailOpenTest". But this should be a random/unique ID per user actually. But as the mailing is not personalised, I wonder if it would be possible to track individual users?
Does this mean I have to include javascript in the mail? Would that even work in all email clients? Or are there other options?
All suggestions are welcome.
Assumption: you are using a mail client like Mail Chimp
Assign a unique id to every email on the email list. lets say this unique id is uid
Create a custom dimension in GA, lets name it as Client Mail Id with index say 1
Create the same pixel just like you have created above in the OP.
Add a custom Dimension in the hit as
http://www.google-analytics.com/collect?v=1&tid=UA-XXXXXX-X
&cid=EmailOpenTest&t=event&ec=email&ea=open&el=EmailOpenTest
&cs=newsletter&cm=email&cn=Email&cm1=1&cd1=uid
In place of uid, you actually need to pass the mail list unique id for that email
How it will work
Once the user sends this hit, your unique id will be recorded in custom dimension 1.
Generate a custom report in GA with event category=email & event action=open and add a dimension custom dimension 1.
All the id's displayed there have actually opened the email ;)
PS: It's tried and tested, so won't cause any issue. Also if you don't want to use custom dimensions, you can also send this id in event label or event value
PPS: In any mail client, getting unique value for that email is pretty easy. You can actiually use its position number or add another column for the unique id, then grab that id win the template
The cid is the clientId, an identifier that is used to aggregate pageviews into sessions, and sessions into unique users.
The way to use that in email-tracking would be to capture the client id when a user subscribes to your newsletter and then insert it into the email links. Since your mails are not personalized this will not work.
If you use a random ID you will not be able to link the request from the mail to an existing user. So one way to deal with the problem would be to ignore it - using a constant userId would still give you an event count (the unique events metric might be a little of if users click the link multiple times within a session lifetime).
If for some reason you absolutely need to track these as different users you can set up a redirect - do not send data to ga directly from your mail, instead call a script on your server that inserts a random clientId and then sends the data to Google.

Google Analytics - Using Client ID as a custom dimension

Can I use client ID as a dimension in my reports? Client ID does not appear as a dimension in the Dimensions and Metrics Explorer, but I believe I can create a custom dimension that will store the Client ID. My end goal is to have a row per customer/date+time containing the incidents associated with the particular customer at the particular time, e.g. page visits, particular events etc
Once you've created the custom dimension in GA, you can start tracking it via analytics.js with the following code:
ga(function(tracker) {
// Assumes dimension is at index 1.
tracker.set('dimension1', tracker.get('clientId'));
});
I found that the google analytics will NOT save your custom dimension if it matches the value of "client id" (even if that id isn't actually PII). However, if you alter the "client id" to become a different value, it will save properly.
Here are the guidelines about what you are allowed to send

Resources