Last active
December 17, 2015 03:09
-
-
Save bretterer/5541558 to your computer and use it in GitHub Desktop.
Disqus Wordpress callbacks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In a js file | |
disqus_config = function() { | |
this.callbacks.afterRender.push(function() { /* your code */ }); | |
this.callbacks.onNewComment.push(function() { /* your code */ }); | |
/* Available callbacks are afterRender, onInit, onNewComment, onPaginate, onReady, preData, preInit, preReset */ | |
} | |
example | |
Place the following right before the disqus element javascript | |
function disqus_config() { | |
this.callbacks.onNewComment = [function() { trackComment(); }]; | |
} | |
function trackComment() { | |
s.events="event7" // Blog Comments Submitted (Success Event) | |
s.eVar25= s.pageName // Blog Page Name Counter | |
s.eVar26= s.prop20// Blog Post Category Counter | |
s.eVar27= s.prop25// Blog Post Author Counter | |
/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/ | |
s.t(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment