0 votes
in SoSci Survey (dt.) by s130803 (420 points)

Hallo,

ich bette in meinem Fragebogen über ein iframe-Element per HTML ein Dashboard ein, das in Shiny erstellt wurde. Jetzt würde ich gerne aufzeichnen, wie oft die Teilnehmenden mit dem Dashboard interagiert haben. Ist es möglich hier über SoSci Survey die Anzahl der Klicks zu erfassen? Wenn ja, wie gehe ich hierzu am besten vor?

Besten Dank und viele Grüße

1 Answer

0 votes
by SoSci Survey (305k points)
selected by s130803
 
Best answer

Nein, das ist nicht ohne Weiteres möglich, denn Browser blockieren in aller Regel die Kommunikation zwischen Fenstern unterschiedlicher Domains (Cross-Site Scripting).

Wenn Fragebogen und Dashboard also auf unterschiedlichen Servern liegen, wäre einiges an zusätzlicher Arbeit notwendig, um die Messung der Klicks zu erlauben. Konkret müssen Sie einen Kommunikationskanal mittlels Window.postMessage() etablieren.

With the DOM HTMLIFrameElement object, scripts can access the window object of the framed resource via the contentWindow property. The contentDocument property refers to the document inside the <iframe>, same as contentWindow.document.

>From the inside of a frame, a script can get a reference to its parent window with window.parent.

>Script access to a frame's content is subject to the same-origin policy. Scripts cannot access most properties in other window objects if the script was loaded from a different origin, including scripts inside a frame accessing the frame's parent. Cross-origin communication can be achieved using Window.postMessage().

(https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe)

Damit das am Ende funktioniert, muss aber auch im Dashboard JavaScript integriert werden. Dieses Script muss die Klicks zählen und an den Fragebogen im iFrame zurückmelden.

Willkommen im Online-Support von SoSci Survey.

Hier bekommen Sie schnelle und fundierte Antworten von anderen Projektleitern und direkt von SoSci Survey.

→ Eine Frage stellen


Welcome to the SoSci Survey online support.

Simply ask a question to quickly get answers from other professionals, and directly from SoSci Survey.

→ Ask a Question

...