Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What should be logging when debug is true #25

Open
ponchorage opened this issue Dec 3, 2015 · 3 comments
Open

What should be logging when debug is true #25

ponchorage opened this issue Dec 3, 2015 · 3 comments

Comments

@ponchorage
Copy link

What should I see in the console log when I have set debug to true in the options? I've tried but I'm not seeing anything at all for some reason.

@mparpaillon
Copy link

Me neither... But I'm using videojs 5 and this plugin seems to work with v4 only. So I guess that's the reason why I don't see any log

@devkinetic
Copy link

I don't see this working in v5 either. Investigating.

@devkinetic
Copy link

devkinetic commented Jan 12, 2017

The plugin works with 5, the debug is working, but not outputting what is expected. I've modified my sendbeacon() function to work as expected. Also, note my plugin initialization.

videojs('thing').ga({
  'eventsToTrack': ['play', 'pause'],
  'debug': true
});
sendbeacon = function(action, nonInteraction, value) {
      if (window.ga) {
        if (options.debug) {
          console.log(action, value);
        }
        ga('send', 'event', {
          'eventCategory': eventCategory,
          'eventAction': action,
          'eventLabel': eventLabel,
          'eventValue': value,
          'nonInteraction': nonInteraction
        });
      } else if (window._gaq) {
        if (options.debug) {
          console.log(action, value);
        }
        _gaq.push(['_trackEvent', eventCategory, action, eventLabel, value, nonInteraction]);
      } else if (options.debug) {
        console.log("Google Analytics not detected");
      }
    };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants