I am trying to show Google calender in rails page. If i log in browser (in gmail account) i can see the Google calender with details in localhost if i sign out from Google account i can't see my calender details in localhost. How to fix this?
I am using iframe to embed Google calendar in rails.
require 'gmail'
class CalendarController < ApplicationController
def event_display
gmail = Gmail.new('username','password')
end
end
In event_display.html.erb
<iframe src="https://www.google.com/calendar/b/0/embed?height=600&wkst=1&bgcolor=%23FFFFFF&src=vinothinibj%40gmail.com&color=%232952A3&ctz=Asia%2FCalcutta" style=" border-width:0 " width="800" height="600" frameborder="0" scrolling="no"></iframe>
You need to start by looking into authentication (which I am struggling with right now).
Also note that the public's ability to view a private calendar via a private link is also being discontinued.
https://www.google.com/support/calendar/bin/answer.py?answer=1631300&hl=en
-Markus
Related
My clients have put in their website my web-widget, implemented as <iframe> showing a button. I want to track analytics around my clients websites that implement my web widget: how many clicks, and from which websites.
So the <iframe> has src pointing to an html file on mywebiste.com, indeed the html content that shows the button is on my host service and I have access to the code of course.
The widget is used by 3rd party websites. They import my script that put the <iframe> in their webpage. So parent 3rdparty.com has <iframe> pointing to mywebiste.com.
Now, I have put in each html pointed by <iframe>, the GoogleTag integration. I've created a custom-event "click" as trigger, and a "tag" that creates a "GA4 event" to analytics.
If I put these widgets on mywebiste.com as test, triggers and events work and I see on analytics.
If I put this widget on 3rdparty.com, triggers and events don't work. And I can't debug GTAG because is not my website.
Why? Theoretically, inside the iframe there is an independent page, that should send the event to my GoogleTag container, with fields "Hostname" as 3rdparty.com.
This is the example code: Besides using the trigger "element click", I also manually push dataLayer to trigger the custom event.
<!-- 3rdparty.com/index.html -->
<html>
<!-- I pass hostname as param -->
<iframe src="https://mywebiste.com/widget.html?hostname=3rdparty.com"></iframe>
</html>
<!-- mywebiste.com/widget.html -->
<html>
<head>
<!-- import Google Tag manager -->
</head>
<body>
<button onclick="fireEvent()">Click me!</button>
<script>
function fireEvent()
{
var hostname = getUrlParamValue('hostname'); // = 3rdparty.com
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({'event': 'button_click', 'Page Hostname' : hostname});
}
</script>
</body>
</html>
I would like to have stats about clicks of the button, with the hostname source details (3rdparty.com)
If you are using the default/standard Google Analytics tag in GTM, its cookies only work in first-party context. They are subject to SameSite attribute. Your widget won't be able to access the GA cookie(s) and GA won't send any events then.
This can be fixed.
For GA UA add a field "cookieFlags" with the value "samesite=none;secure" to your "Google Analytics Settings" variable in GTM (More Settings, Fields to Set). developers.google.com
For GA4 add a field "cookie_flags" with the value "samesite=none;secure" to your "Google Analytics 4 Configuration" tag in GTM (Fields to Set). developers.google.com
I have an embedded google calendar (agenda) on my website.
Currently it defaults to showing all events in the next two months.
How do I change this to show all events in the next six months?
Here is my embed code generated from my calendar settings
<iframe src="https://calendar.google.com/calendar/embed?showTitle=0&showNav=0&showDate=0&showPrint=0&showTabs=0&showCalendars=0&mode=AGENDA&height=600&wkst=1&bgcolor=%23FFFFFF&src=fgltphnkd8mvpnvu7ecp1cjpr8%40group.calendar.google.com&color=%238C500B&ctz=Australia%2FPerth" style="border-width:0" width="800" height="600" frameborder="0" scrolling="no"></iframe>
Note the various option=value pairs. Is there any documentation for these?
I'm looking for a start-date - end-date type option?
When creating an event with the API:
https://developers.google.com/google-apps/calendar/v3/reference/events/insert
If I fill the fields source.title and source.url:
source.title string Title of the source; for example a title of a web page or an email subject.
source.url string URL of the source pointing to a resource. The URL scheme must be HTTP or HTTPS.
With the old interface, on the event I could see a read-only field, between "Calendar" and "Description":
Source [Link icon] The title of my link, from [source.title]
And "The title of my link, from [source.title]" was a link to [source.url]
With the new calendar interface, the same event instead shows:
[Email icon] This event was automatically created from an email. [View confirmation]
And [View confirmation] is a link to [source.url]
Am I missing something? Is that a bug on the new interface or is the API documentation deprecated for these fields?
The bug tracker link to that issue: https://issuetracker.google.com/issues/73334552
There was recently a large upgrade of the Google calendar web UI. This happend around October if memory servies.
This looks like a bug to me there have been a few of them asssoicated with the API and the new web UI not being updated and fully tested.
I am going to reach out to my contacts at Google to have someone check this in the mean time would you mind posting this on the issue tracker and pasting me the link? issue tracker
I am working on Windows 8 App where I need to show a web page with facebook "Like/Unlike" options. Below is code which I added for Like.I need to add Unlike option too. Can some one explain me how to get this done ?
#section AdditionalHeaderContent {
<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
}
#section ContentFooter
{
<div id="fb-root">
<fb:like ref="#Url.RequestContext.HttpContext.Request.Url.ToString().EnsureTrailing("/")" show_faces="true" width="450"></fb:like>
</div>
}
How can I show "unlike" button?
Thanks.
The Facebook like button also is your Facebook unlike button. The Facebook button knows if you already liked the page.
So when you click on it again you are "unlike-ing" it again.
*update * *(so you do not have to check the comments)*
This button uses Javascript that has been hosted by facebook, you can not edit that.
----- What you can do ----
If it is possible to make a custom separate Like and "Unlike" button this would be the way to do it.
Use the c# Facebook SDK to code things for Facebook yourself.
( http://csharpsdk.org/ )
You can look up the Facebook API here.
( https://developers.facebook.com/docs/reference/apis/ )
i am using feeds module for import news items.By using views,i display the news title,description and item url.In this,when user hit the item urls means its loads that particular site inside my site.I try to use Iframe by way of "output rewrite option" in views.But that page load fully instead of load inside my site.I use following code for that.
<iframe src="[url]" width="100%" height="300">
<p>[url]</p>
</iframe>
Any one please guide me resolve this.
thanks
This can be achieved using the target attribute on an a tag. For example when the user hit's the item URL it would load in the target window which in this case is the frame. Take for example the code below.
test
<iframe name="target_frame" src="http://www.google.com" frameborder="0" width="300" height="300"></iframe>
The frame initially loads google.com but once the link is clicked the target attribute on the a directs the click to the frame which has the same name attribute, in this case target_frame
You can read more about the target attribute here http://www.w3schools.com/tags/att_a_target.asp