Guest User

Untitled

a guest
Mar 22nd, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. /* Instruktioner */
  2. // - Opret de to tracking funktioner i Hype:
  3. // - Resource Library -> + -> Add Javascript Function
  4. // - Copy paste første funktion ind og omdøbe javascript funktionen til "startTrackingFunction"
  5. // - Gentag processen med næste funktion (completeTrackingFunction)
  6. // - Tilføj event (start), ved første interaktion med produktionen (Inspector -> Actions -> On xxx -> + -> Action: Run Javascript -> startTrackingFunction
  7. // - Tilføj event (complete), ved sidste del af Hypeproduktionen (i den action der går til sidste step).
  8.  
  9. // NB: Scriptet sørger for, der kun bliver tracket én gang for henholdsvis start og complete.
  10.  
  11. // element - DOMHTMLElement that triggered this function being called
  12. // event - event that triggered this function being called
  13. // function startTrackingFunction (hypeDocument, element, event) {
  14. if (window.productionName === undefined) {
  15. window.productionName = 'eb-' + document.title.toLowerCase() + '-hype'
  16. var trackingData = {
  17. 'eventCategory': 'EB interaktiv',
  18. 'eventAction': window.productionName,
  19. 'eventLabel': 'First interaction',
  20. 'eventValue': 0,
  21. 'eventNint': 0
  22. }
  23. parent.postMessage(trackingData, '*')
  24. }
  25. // }
  26.  
  27. // element - DOMHTMLElement that triggered this function being called
  28. // event - event that triggered this function being called
  29. // function completeTrackingFunction (hypeDocument, element, event) {
  30. if (window.productionName && window.completedTrackingData === undefined) {
  31. window.completedTrackingData = {
  32. 'eventCategory': 'EB interaktiv',
  33. 'eventAction': window.productionName,
  34. 'eventLabel': 'Completed interaction',
  35. 'eventValue': 0,
  36. 'eventNint': 0
  37. }
  38. parent.postMessage(window.completedTrackingData, '*')
  39. }
  40. // }
Add Comment
Please, Sign In to add comment