We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33968
    • 863 Posts
    Will soon spend 24 hours a day just updating view counts
    You don’t want to do that smiley

    This should be fairly easy to achieve - can you post your video player markup including the ’play’ event GA uses for tracking?

    And... how are your videos structured - does each video have it’s own resource with title, TVs, etc?

    I think the best way about it is to call a simple snippet which increases your play count by one each time the ’play’ event fires. The play count might be recorded in a TV so you wouldn’t need the CSV at all.
      • 27716
      • 126 Posts
      Hi Lucas,

      I’m hoping to keep the view counts matched exactly to the Analytics data. Im not hoping to count play button clicks separately. I think there would be a big discrepancy in the numbers.

      I don’t have the code that triggers the GA event tracking because it is a plugin, thai I call with

         plugins: {
                  'gapro': { accountid: "UA-xxxxxxx-xx" },
      


      I presume the plugin code uses this
      http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html


      The way I’m displaying views now is by just entering the number from analytics into a TV which displays in a template

      The rest of the player code is as below

      <script type="text/javascript">
          jwplayer("container").setup({
              duration:,
              autostart: true,
              flashplayer: "/assets/components/jwplayer5/player.swf",
              width: ,
              height: ,
              plugins: {
                  'gapro': { accountid: "UA-xxxxxxx-xx" },
                'viral':{onpause: "true"}
                   },
              file: "filename.flv"
          });
      </script>


      Let me know what you think.

      I like the idea of a snippet that executes, stores a static number and doesn’t have to parse a CSV or access GA API every time a user visits.

      Any guidance appreciated.

      Stuart
        • 33968
        • 863 Posts
        Quote from: smcilreavy at Jun 15, 2011, 09:41 AM

        I’m hoping to keep the view counts matched exactly to the Analytics data. Im not hoping to count play button clicks separately. I think there would be a big discrepancy in the numbers.
        Seeing as the snippet would fire on the same event as GA, any discrepancy here would be due to a poor connection to Google. If anything, the local values that would be stored in your TV should be more realistic. It would also be a lot easier to implement smiley

        However if you want to go the ’nightly GA sync’ route, you might want to look into CronManager for scheduling the snippet to run at a certain time each day. I guess you would create a dedicated resource or external php file (connected to modx), containing a snippet that would connect to GA and grab the stats, then loop through all your videos and update the ’plays’ TV for each.