Qualtrics Embeds read by iFrame for GA - javascript

Thanks for taking a look at this. My task at hand is to put a html page in qualtrics, as an iframe (is the current thinking), and from that to see if I can get user data through event tracking to be sent to Google Analytics. So far, I understand how to send events to GA, and I'm working on the Custom Dimensions, but I have to wait a day to see if that's worked.
What I need though, is a unique ID, which I generate with qualtric's random number generator php. I need this unique ID to be sent to Google Analytics so that I can identify who's doing what on the embedded page. So I've looked at the Qualtrics javascript stuff, and I can get qualtrics itself to generate the id through javascript:
<script language="javascript">
var user = '${e://Field/user}';
document.write (user);
</script>
This works to just display the number in Qualtrics, but I know I'm missing a huge step, because implementing the same thing in an embedded webpage won't work - will it? I've tried, without success, and I've even used the
Qualtrics.SurveyEngine.addOnload(function()
{});
without success.
If you have any suggestions, that would keep the user in Qualtrics, but pass the embedded data for a unique individual's user events on an embedded webpage to GA, I'm all ears. Any reconceptualizing is cool to.
I'm just trying to figure out who is doing what on my embedded pages (iframed webpages) in Qualtrics.
Maybe this source will help: http://ut1.qualtrics.com/WRAPI/QuestionAPI/classes/Qualtrics%20JavaScript%20Question%20API.html
Thank you very much for any advice or direction.

Related

Prepopulate a Google Form using ID without using emails

Here's my situation. I have a long list of students (each student with an ID); and each student have their own preferences on food, and games, ... (all of these data are stored on a Google Spreadsheet). I'd like to confirm all the students that the info are all correct.
I can do this by sending each student with a prefilled-link a Google Form, then after they edit, and hit submit, I'll scan and update the spreadsheet, and resend them the new link with pre-filled information that they've just editted.
However, I find it to be a little bit 'messy' (? I'm not exactly sure if this is the right word, as they have to check their emails, click on the link, and when they need to modify their data yet again, they have to find the newest email sent by me, and click on the new link).
I wonder if this can be solved just by using only Google Form (or maybe by embedding a Google Form inside another page?)? I'm thinking off creating 2 Google Forms:
One form for the students to enter their ID, and when they hit submit they'll be taken to the second Google Form with their newest info (fetched from the spreadsheet) pre-filled for them.
The second form is the form filled with their previously-entered information.
Since Google App Script will not allowed me to redirect the users to some other website (including, other Google Forms?) upon form submission, so I'm thinking of embedding the ID Google Form into my site on Google Site.
Here's my pretty bad embedding:
<!-- Normal form embed code, add an ID -->
<iframe id="gform" src="https://docs.google.com/forms/d/e/MyFirstFormURL/viewform?embedded=true" width="640" height="700" frameborder="0" marginheight="0" marginwidth="0" style="margin:0 auto; max-width:100%;">Loading…</iframe>
<script type="text/javascript">
var load = 0;
document.getElementById('gform').onload = function(){
/*Execute on every reload on iFrame*/
load++;
if(load == 2){
/*Second reload is a submit*/
document.location = "https://docs.google.com/forms/d/e/MySecondFormURL/viewform?embedded=true";
}
}
</script>
But I run into 2 problems (or maybe 3 problems):
I use onload event for the iframe to check whether the form has already been submitted; which is bad, since it will still direct me to the second page even when I hit "Clear Form".
I cannot read the ID the student provided inside the Google Form embedded in iframe. :(
Even if I can somehow read the ID in my Google Form, I have no way to externally perform a search on my spreadsheet to get the desired pre-filled link (it must be done by GAS back-end, right?)
I have some basic knowledge in programming (like a tad C, and C++; but I have very little (next to nothing) experience when it comes to web-development), I just list out everything that I have thought about, and worked on in this post. :(
Can someone give me a push? :(
Thank you so much in advance, :*
There's a variety of ways this can be done, but here's what I would use. The major advantage of this approach is that it wouldn't require any app script coding.
Rather than email a direct link to a form, I would send the students a link to a webpage that is actually a google spreadsheet (example here --Feel free to submit test data on the form).
Make sure to link the form's responses to appear in the same spreadsheet and then use an index and Counta function (see below) to get the respective latest answers to appears as I did in cells b3 and c3 in screenshot below. These latest answers can be embedded in the link to the form shown in cell A3 which ensures that the spreadsheet will always have a link to the latest submission.
Note if you want to give your students a link to the actual spreadsheet, that would be a little less browser compatible but offers instant updates to the updated form link, whereas a webpage refreshes every 5 minutes.
Good luck.

show contents of link

I've been searching the internet to get some information about how i can be able to detect and show what a url is about.
Facebook has a good example of what i actually want to achieve:
If you create a update on facebook and paste in a URL, facebook will detect some information about it and show a box with some text and often the right picture.
for instance, take: http://www.ebay.com/itm/Mens-Monk-Strap-Loafers-Suede-Lined-Metal-Buckle-Slip-Casual-Dress-Shoes-New-/311170422772 . then it shows the image of the shoe and headline.
Ive found other services which does this with image services and youtube, but what i need is about getting information of products most of the time, so often urls from shops. So the user pastes in a url, and i can detect what that link is about.
any ideer how this can be done ?
Is it backend code, like c# or javascript ?
Hopefully some of you can point me in the right direction. Thanks in advance!
Facebook scrapes pages for specific metadata in the back-end and uses it to generate the snippets you see, which can either be served along with the initial page load or brought in via JavaScript (front-end). From there it's a matter of using CSS and JS to style the popup to your liking.
Depending on how inter-related your site is with the content you want to display, this can be an easy task or a difficult one.

User-Generated-Content—where to start? Users submits content into divs which adds to the gallery

A user would click a submit button and a function would create a div in a gallery on my site with which they could link to if they wanted to share that content specifically. The content is just embedded and hosted on other sites like youtube so the user would not be actually uploading any content or need an account. It's a free open gallery that anyone could copy a url and paste into an input and submit that content into a div in the gallery.
Any ideas where to start? Would this require php?
Well if you're a super beginner or something the first step would be to make your website just the way you want it and inside these div's you can just put the url that the user submitted instead of the content that url points to. [If you can do this then I assume you wouldn't need to ask this question, so don't mind me treating you like a complete beginner]
How would you achieve this? Well you're definitely need:
Some sort of server side language (php is a good choice) that allows you to use the input from the user (The POST request from the form he/she submits),
Check it for correctness / clean up the input / supported websites, etc.
Save this information somewhere (a database) so that you can get it back later.
The next steps would be to now get the information from the database and show it on your gallery page like you want it. This involves:
Getting whatever subset of information you want to display on a particular page from the database. Perhaps only cat related things or something, I don't know.
Just displaying it in your div's using a for loop or something.
.
foreach ($subset as $url) {
echo "<div>$url</div>";
}
Then the last step would be to convert these links into actual videos / images or whatever depending on the type of link. This can be done both client side using Javascript / server side using php or some other language.
This is going to be a lot of manual work, looking through every websites api and figuring out how to convert a url into a video for example. Images are easy but they may be hotlink protected so you might have to go through an API there as well.

Loading and running an external webpage

I have been asking this question in different places but couldn't get a real answer.
Here is the problem:
Let say I have a web page which is going to serve like google. I mean it will use google at the bacground but foreground will be my page. It will contain a textbox and a button. So a user will come and enter a text that he wants to search and click the button to submit the query. So my webpage will transfer this search text to the google at the background and search the thing in google. It will return the results to my webpage in a different form. `
So the question is, what is the best way of implementing this and more importantly is it possible.
Many thanks.
You will have to use Google Custom Search API: https://developers.google.com/custom-search/v1/overview
You cannot use classic web crawler techniques to get the data from Google since that violates their TOS.

How to get the number of time a user visit a page?

Does anyone have any idea about how to get the number of time a user visit a particular site? For instance, if you do a search on google and there's a link that you clicked already, google will tell you how many times you have visited that particular link. Any ideas on how to code something like that using javascript?
Thanks.
In Google's case they can track that you have clicked on a link. Its a specific action that they can attach a javascript listener to. If you want to do the same thing on your own site, you can add some javascript that does something similar, and anytime a link is clicked an AJAX call can be made that will allow you to track that it was clicked.
However, if you are just looking to get some basic stats about pages on your site you can add Google Analytics to it, and it will gather a large amount of useful data for you.
http://www.google.com/analytics/
If you want to know how many people are visiting your page, you probably want to check out something like Google Analytics rather than making it yourself. It will give you a lot of data that you'd have to make a lot of effort to gather yourself.

Categories

Resources