Google Analytics for Scenes

While this post is helpful:

Is more like a workaround than a real solution, the results in google analytics is not really comprehensive and for clients who ask for a SEO information it put me in a complicated relationship with Hype and my work.

It could be amazing if Hype have such feature built in in where we could trust to work OOB.

Thanks for the request! What types of data would you expect to be sent (by default)? Here’s the event tracking template:

ga('send', {
  hitType: 'event',
  eventCategory: 'Video',
  eventAction: 'play',
  eventLabel: 'cats.mp4'
});

More info about event tracking here: https://developers.google.com/analytics/devguides/collection/analyticsjs/events

This type of feature is tricky because everyone uses and collects data from GA in different ways, but would like to hear how you use it.

Its more about a commodity.

For this new website im working I could be fine using the code in the post I shared, BUT, in the ones I have done before and I’m being asked to track the scenes, well, some of them have 24 scenes, and adding the code to each one is quite a chore.

I was thinking about using

if (hypeDocument.currentSceneName() == “a” || hypeDocument.currentSceneName() == “b” || hypeDocument.currentSceneName() == “c” || hypeDocument.currentSceneName() == “d”)

But the problem would be if someone reach the site from other page other than the home, for example, if someone reach the site from “contact”, the code will not load, so I’m forced to add the Analytics code

_gaq.push(['_trackEvent', 'Scenes', 'Load', hypeDocument.currentSceneName()]);

manually to each scene.

I noticed that the code from DavidA indeed work just fine in Google Analytics

So is more about Hype automatically adding that code to each scene without the need to adding them to each scene all the time.

i guess you can make use of hypes event callback system … have a look at the js-documentation

1 Like