Google calendar add event with redirect url - javascript

I'm trying to add a button to my website that will add an event to my google calendar, I found this url:
https://calendar.google.com/calendar/r/eventedit?text=Your+Event+Name&dates=20140127T224000Z/20140320T221500Z&details=For+details,+link+here:+http://www.example.com&location=Waldorf+Astoria,+301+Park+Ave+,+New+York,+NY+10022&sf=true&output=xml
which works and it's really handy to configure, but I'm wondering, because when I click on it, it takes me to google calendar and it will never come back to my site.
Is there a possibility to add a some parameter to once the event is added, make google calendar redirect to my website?
Thanks in advance.

No there is not a way to do this. Your best bet is to have this link open in a new tab/window so that the user still has your site open.
Another option is to use the Google Calendar API if you're adding a lot of events for a user and have them authenticate. This way you can just use an API to add events and keep them on the page. I would not suggest this solution if you're just adding an event here and there as it's quite invasive to give calendar access to an application.

Related

Javascript Profiling with Chrome Devtools

I am trying to profile some javascript code on this url by setting an event listener breakpoint on mouse click.
When you click on any flight on the results page, it opens a new tab with another link and the logic to build that link must be using javascript, since there is no network traffic going on when the click is done.
The problem is when doing a profiling it shows some js functions called but none of them related to the new tab opened. Maybe it is related to some other event? Any other ways to profile this use case?
Basically the goal would be to understand how that new tab link is generated and get it without the need to actually click it, using data that must be already present somewhere on the code beforehand.
Any insights would be appreciated!

How to get Google Tag Manager Event Tracking to send to Google Analytics?

My website has a tel: link in the header, and I want to see in Google Analytics when this link is clicked, and on what page. I've decided to do this using Event Tracking in Google Tag Manager. So I made a tag, with the following configuration.
And this is my Trigger configuration.
This is the HTML that this is referencing, (note that I also tried to add an onclick attribute, which was meant to push Event data directly to analytics. This didn't work.)
This is the variable configuration used in this tag.
This is proof it fires in the GTM debug pane.
And this is the summary coming in when you click on the item withing the pane.
In Analytics, this is what I see in the Real-time events tracking.
And this is what I see under the events overview.
So the tag is firing correctly, but the information is not going over to Analytics. I can find no resource on the internet that addresses this issue. Has anyone successfully pushed Google Tag Manager event tracking into Google Analytics? If so, what did you do to make it work, and what am I not doing/doing wrong that is preventing me from the result?
The end goal is I want to track the page where the click happened in Google Analytics' Events Overview, and also in the Goals section.
Thanks for that link, Uda! What was going wrong was my Google Optimize Tag. I paused all tags except my click-tracking and my Universal Analytics

execute refresh google calendar UI after inserting public calendar with GAE

Execute refresh google calendar UI after inserting public calendar with GAE.
I create a gadget with GWT and GAE, using URL to add it in the Google calendar, this app, just add a list of public calendar for the current user connected.
Everithing is ok, except that I it didn't detect that exists a change, and it is necessary use the Refresh option button of the browser to reload the entire page to see the new calendar.
Any one know a way to inform the google calendar, that the current user have new calendar, and it must do the refresh.
Or a way to call the refresh method using JavaScript from the iframe inside of the gadget ?
Thanks any help.
There's no built-in API to do this. However, if you absolutely must offer this feature, and can't rely on Calendar refreshing itself, you can force a reload of the entire Calendar page by calling the following within your gadget:
window.top.location.href = "https://www.google.com/calendar/render";
It's a pretty nasty user experience, so weigh this carefully with other options.

Tracking Social Button Clicks in Javascript

On a website, I have some social buttons (tweet, facebook like, google+1, ..). Most of them are inserted using an iframe.
The task is to track use interaction with those buttons: if someone +1'ed the content - and AJAX request should update my local statistics on the server.
However, with JS I can't access the contents of the iframe due to security restrictions: can't bind 'click' event.
How do I track clicks on those social buttons, then?
Possible solutions:
Bind 'click' to the iframe object itself: it does not work.
Add buttons inline, w/o an iframe. No go: I should also display the number of likes for every button.
Try to use Social Service APIs to insert without an iframe. Not all services support this.
You can't. If you could catch clicks on them you could also trigger clicks on them which would be pretty bad (imagine porn sites making you "like" them automatically).
The only thing you can do is using the APIs of the various sites to retrieve the number of people who liked/+1'd/etc. your site.
Most of the social buttons from the main companies enable your Javascript to detect when the button has been pressed. They usually do this via Javascript events.
In other words, they'll tell your code that they've been pressed, you don't have to detect it on your own.
Twitter
info on their javascript events
Facebook
You need to use the XFBML version of the button. From the Facebook Like button FAQ
How do I know when a user clicks a Like button?
If you are using the XFBML version of the button, you can subscribe to the 'edge.create' event through FB.Event.subscribe.
Google +1
See the callback parameter in their docs. See section +1 Tag Attributes. You provide a Javascript (JS) function to their button. Your JS is then called by them when the button is pushed. Easy!

FourSquare Follow Button with Google Analytics

Is there a way to catch the click event on the FourSquare follow button (https://foursquare.com/business/brands/offerings/followbutton) in order to add Google Analytics tracking with it?
Is there an API similar to the Twitter Tweet button and the Facebook Like button?
I couldn't find anything on the FourSquare site.
There doesn't appear to be comprehensive documentation of the Foursquare follow button, but I've been able to glean this much:
Unlike the Twitter and Facebook buttons, the Foursquare button is not in an iframe. That means you can capture clicks on it as you would clicks on any other element.
$("div[id^=fourSq_widget_id] a").click(function(){
_gaq.push(["_trackSocial", "Foursquare", "Click"]);
});
However, tracking this click doesn't mean anything; it doesn't tell you if the person followed through on the action of following, since that action takes place in a third party iframe.
There does appear to be an undocumented JavaScript API in the fourSq object for tracking the actual follow through on the action, but its not clear how to enable it.
It looks like it's something like:
fourSq.widget.Events.bind("follow", function(){
//do something
});
However, the only way I can seem to trigger it manually is with the accompanying trigger method. So, I'm not sure how to enable this undocumented JavaScript API so that it listens to actions taken in the modal window that pops up..
You could use Google Analytics Tracking feature, check this: http://code.google.com/intl/fi-FI/apis/analytics/docs/tracking/asyncUsageGuide.html

Categories