Check that a link has been clicked - google-apps-script

I would like to keep track of how many times a certain link in Google Spreadsheets has been clicked. I have been searching but I can't seem to be able to find how to check whether a link has been clicked or if it is possible to attach onclick event on a link.

A quick solution is to use the Google URL shorten service for the links. This page gives you the number of clicks per link.

its not possible, you cant detect cell or link clicks.
Two possibilities here:
One way is to have a server (or an apps script service) be the link "proxy" and redirect to the final site as in:
script.google.com/.../exec?url=myurl.com
your script tallies the hit and then redirects the user. redirecting without an extra click might not be possible with apps script htmlService but its possible on your own server.
you can make the urls look pretty by using =hyperlink in the cells so users dont see the long url (until click)
Another way if you have control of the links you are pointing to is to use analytics on those pages. You can use the referer to tally views that came from a spreadsheet click, or you can explicitly add parameters to each url so that youcan later filter those comming from your sheet.

Related

Moving an item from one Google form to a new Google form using google apps script

When editing a Google form manually, you can usually click on an item, and on the side appears a menu, which includes the button "import questions". This button is very useful for me as it allows me to collect questions from past Google forms and import them to new Google forms.
But I'm looking through the Forms documentation, and I can't figure out how to do this via Google apps script programatically.
Here is the documentation:
https://developers.google.com/apps-script/reference/forms/form
The closest thing to what I want is the .moveItem() method, which moves an item from one spot in a form to another. But it only works within the same form. I want to know if I could do it across forms. And ideally, instead of moving the item, it would make a copy of the item in the new form.
I considered the .getItems() method, but there doesn't seem to be a general .addItem() method I could use on the new form. Would I have to go through the painstaking process of having to identify each item type, and specify how the details of each one should be copied to the new form, including things like point values of a question and whether or not the question is required?
I want to import from forms that have all kinds of content: video, images, multiple choice questions, grid questions, number scale questions, etc. I feel that if I have to specify the details of each item type, it would take too long, and I would be bound to miss something or run into an error that may be impossible to solve. Is there not an easier way?
And if specifying each item type is what I have to do to import everything properly, has someone else created that code already that I can re-use?
Issue:
In the current stage, unfortunately, it seems that Forms Service cannot copy all items. Ref1, Ref2 Ref3. And, unfortunately, moveItem can be used for the same Google Form as you say.
Workaround:
In your situation, as a workaround, how about copying the source Google Form? And, when there are some items you want to remove, you can remove them. I thought that this process can be achieved by Google Apps Script.
But, I'm not sure about your actual Google Form. So I'm not sure whether this is a suitable method.
Future:
Recently, Google Forms API was announced. Ref When this API got to be able to be used, your goal might be able to be achieved by retrieving the object from Google Form. Unfortunately, I'm still not sure about the detail of it.

Typeform integrate google map place suggestion api

i want to add google map places suggestion API on typeform specific search text field.
is there possible anyway? because i can not find any way like via JavaScript to embed JavaScript code on typeform or 2nd i try where used this form it's also prevent to return iframe content.
My understanding is that you want to use a google places autocomplete field directly inside a typeform.
Is that right?
At the moment this is not possible on Typeform platform.
One workaround could be an intermediary step before the typeform, like a static HTML page where you present the user with such a field, and pass this data as hidden field to the Typeform.
If you want to restrict people within a certain location to answer your typeform here are some other alternatives:
using google tag manager ask for user's location, and redirect them out of the typeform if it does not fit your requirements
intermediary step to ask for user location (via the browser) and redirect them to the typeform or not
implement Typeform logic on a zipcode or country field.
Hope it helps,
You can also contact Typeform support directly if you have more precise questions.

How should we use google analytic script in django?

Can we add google analytic script in tag and push it to the GitHub or we should keep it secret i.e. add it to the .env file and call in .
When I tried by the second one it appears in the source page as it is and also not working properly.
I would say there is no meaning of hiding it because it is also shown when 'view page source' is clicked. All you need is a simple filter. It will only include traffic on your domain, protecting yourself from any data corruption when people hijack your Google Analytics Property ID.
To find your filters:
Go to your Google Analytics standard reports
Click on the “Admin” button in the top right
Click on “Filters”
Click “+ New Filter
Then use these settings for your filter:
Select “Create New filter for Profile”
Name your filter with something snazzy like “Hacking Defense”
Select “Custom Filter”
Select “Include”
For the Filter Field, select “Hostname”
If your site is LarsLofgren.com, you would define the filter pattern
as “larslofgren.com” and make sure to include a “\” before any “.”
Pick “No” for case-sensitive
At the end of the day, your analytics id will be visible on your website. So, I don't think you should make an effort to hide it.
Just add it to your base template and you should be ready to go :)

How to add event in google calendars to user who fill the google form

I want that if some people fill the google form, the new event fall in his google calendar. How it is possible to do?
Here is a web site I used to do the exact thing.
http://www.jessespevack.com/blog/2016/2/9/turn-a-google-form-response-into-a-calendar-event
Follow the steps and its not to bad.

How to edit choices with images in Google Script Editor?

I've got a Google Form which is attached to a spreadsheet and a script. It's got one radio button field. When a choice is made, I want to run the script to remove the choice from the list. So far so good - I've got this working well.
However, when I use images with the choices, the script removes all of the images. Is there a way of not deleting the images? Or at least a way of accessing the images associaed with a Choice to get me started?