Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Instruktioner */
- // - Opret de to tracking funktioner i Hype:
- // - Resource Library -> + -> Add Javascript Function
- // - Copy paste første funktion ind og omdøbe javascript funktionen til "startTrackingFunction"
- // - Gentag processen med næste funktion (completeTrackingFunction)
- // - Tilføj event (start), ved første interaktion med produktionen (Inspector -> Actions -> On xxx -> + -> Action: Run Javascript -> startTrackingFunction
- // - Tilføj event (complete), ved sidste del af Hypeproduktionen (i den action der går til sidste step).
- // NB: Scriptet sørger for, der kun bliver tracket én gang for henholdsvis start og complete.
- // element - DOMHTMLElement that triggered this function being called
- // event - event that triggered this function being called
- // function startTrackingFunction (hypeDocument, element, event) {
- if (window.productionName === undefined) {
- window.productionName = 'eb-' + document.title.toLowerCase() + '-hype'
- var trackingData = {
- 'eventCategory': 'EB interaktiv',
- 'eventAction': window.productionName,
- 'eventLabel': 'First interaction',
- 'eventValue': 0,
- 'eventNint': 0
- }
- parent.postMessage(trackingData, '*')
- }
- // }
- // element - DOMHTMLElement that triggered this function being called
- // event - event that triggered this function being called
- // function completeTrackingFunction (hypeDocument, element, event) {
- if (window.productionName && window.completedTrackingData === undefined) {
- window.completedTrackingData = {
- 'eventCategory': 'EB interaktiv',
- 'eventAction': window.productionName,
- 'eventLabel': 'Completed interaction',
- 'eventValue': 0,
- 'eventNint': 0
- }
- parent.postMessage(window.completedTrackingData, '*')
- }
- // }
Add Comment
Please, Sign In to add comment