Client asked me to track Prezi in Google Analytics. However, there is no way how to track iframe embed. Thus I had to use Prezi API to make this running. API is only alfa right now but I hope this basic function will work for a long time. I used Google Tag Manager to make this running.
You can try everything at prezidemo.marketingmakers.net
![image](https://www.michalblazek.cz/wp-content/uploads/2015/08/tumblr_inline_nsrqs064uf1rlljqi_540.jpg)
1. Use api to embed Prezi in the page
You can find all neccessary documentation on Github. This is a code that will place video in the page.
Update 30.6.2017: As of the update in March/April this solution does not work 100%. Unfortunatelly, I do not have a capacity to fix this. If you have, I will help you with the task.
<script src="http://prezi.github.io/prezi-player/lib/PreziPlayer/prezi_player.js"> </script><script> var player = new PreziPlayer('prezi_here', { preziId: 'l3qa8ydbj1l7', width: 620, height: 444, explorable: false, controls: true }); </script>
2. Push event to dataLayer on every slide of a Prezi
I push name of the Prezi presentation and step (slide).
player.on(PreziPlayer.EVENT_CURRENT_STEP, function(e) { dataLayer.push({ 'event': 'trackprezi', 'name': player.getTitle(), 'step': player.getCurrentStep() }) });
3. Create tag in Google Tag Manager that fires when trackprezi happens
Create dataLayer variables
![image](https://www.michalblazek.cz/wp-content/uploads/2015/08/tumblr_inline_nsrqufcLZ01rlljqi_540.jpg)
and then create tag Google Analytics – Event.
![image](https://www.michalblazek.cz/wp-content/uploads/2015/08/tumblr_inline_nsrqvaZKwu1rlljqi_540.png)
This tag should fire when trackprezi happens.
![image](https://www.michalblazek.cz/wp-content/uploads/2015/08/tumblr_inline_nsrqw2r4hn1rlljqi_540.jpg)
This is it! Go to Behaviour -> Events in Google Analytics and enjoy your data!
![image](https://www.michalblazek.cz/wp-content/uploads/2015/08/tumblr_inline_nsrqwiggDl1rlljqi_540.jpg)