Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter SkyEver

    (@sj3vans)

    So the folks over at Wistia were very helpful and we figured this out. We found we can embed a Wistia video in a WordPress post so that it plays without leaving the page but also tracks the user who watched the video based on their WordPress login. Why am I bothering with Wistia? They have some really cool analytics that allow me to see how much of the video was watched and by whom.

    To do it, we used a S2Member short code to grab the email address of the currently signed in WordPress user and embedded that in some JavaScript code. Just replace the video ID with the video you want to display. It needs to be changed in two places. The video ID in this case is “lyxk4fqan6”.

    <script>
    var theEmail = "[s2Get constant="S2MEMBER_CURRENT_USER_EMAIL" /]"
    </script>
    
    <div id="wistia_lyxk4fqan6" class="wistia_embed" style="width:728px;height:410px;"> </div>
    <script charset="ISO-8859-1" src="//fast.wistia.com/assets/external/E-v1.js"></script>
    <script>
    wistiaEmbed = Wistia.embed("lyxk4fqan6", {
        trackEmail: theEmail
      });
    </script>

    Hope that helps some Wistia / WordPress / S2Member users (assuming there are more than just myself)!

    Awesome! Exactly what I was looking for. I have the exact same setup including s2member and wanted to track registered users on wistia.

    One question (I hope you still follow the thread after 7 months) did you do any improvements on this setup and more importantly, I see the code but WHERE do I put it? 🙂

    Thanks

    Thread Starter SkyEver

    (@sj3vans)

    I actually am still following this thread! I’m still using this code and it still works great.

    As for where to put the code, you simply post it on any page or post. Also make sure to switch from the visual tab to the text tab before posting in the code. Otherwise the code will not execute.

    Now, if I can only figure out a way to get a notification when someone plays a video…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to embed Wistia video iFrame link with user tracking’ is closed to new replies.