You can use that snippet just anywhere where it can be rendered on single pages. For example, you can paste this under functions.php of your theme:
function hook_disqus_config(){
if( ! is_singular() ) return;
?>
<script type="text/javascript">
function disqus_config() {
this.callbacks.onNewComment = [function(comment) {
_gaq.push(['_trackEvent', 'Disqus', 'New Comment', comment.id]);
}];
}
</script>
<?php
}
add_action( 'wp_footer', 'hook_disqus_config' );
Disqus should do the rest.
Related Posts:
- Disable plugin / plugin action via theme
- Add Google Analytics manually, or use a plug-in?
- Need a WordPress Plugin for Google Analytics, Favicon, Meta Keywords & Description?
- Google Analytics post views in WordPress? [closed]
- WordPress 3.1 and Disqus throws Warning: number_format() error in Posts List
- Suspicious google tag manager
- Can a plugin deactivate itself?
- Are there any plugins yet that support Facebook Like, Google +1 and allow Social Interaction tracking on Google Analytics
- google conversion code
- Plugin: Google Analytics for Dashboard error – Timestamp is too far from current time
- Comment section not showing correctly
- Disqus deleted comments are syncing with wordpress but active comments do not
- Char limit on custom blog-post form? [closed]
- Invalid plugin installation directory, Google Analytics [closed]
- How to install Google Analytics onto site without internet access
- Moving to a WordPress blog. What do I need to know?
- Where does MonsterInsights put Google Analytics code?
- How to track analytics with a WordPress site under the same domain as my main site?
- WordPress gtag.js with User ID tracking
- How to edit link for comment count
- Google Analytics event tracking code being stripped out of links in Author box – WordPress site
- how does ‘init’ /’parse_request’ hook work for wordpress?
- How to set Google Analytics tracking code on WordPress plugin directory page?
- Get the link title attribute and send it google analytics as custom label via google tag manager using beehive pro for WordPress
- How to remove WordPress Default Comment? not Facebook
- Different Google Analytics code based on Users Device
- Disqus comment system not show
- Tracking sales/conversions in Woocommerce using Google Analytics
- Disqus comments count taking long to update
- Disqus comment system – change comments number before “load more” button
- Google analytic issue in wordpress
- Disqus plugin outputs script as literal text
- Google analytics not working on WordPress
- Questions about using Disqus or Jetpack for comments [closed]
- Plugins menu not on dashboard
- Changing title of a page dynamically from within a plugin
- category_name not working (not showing up in sql query debug)
- Custom plugin settings: clicking “save changes” does not display success message
- WordPress Hook that will run when media file deleted
- Prevent multisite sites from using a plugin
- Plugins won’t auto-update on IIS
- Make plugin uninstalable on older versions of WordPress
- Get the current taxonomy product category title in woocommerce
- Remote plugin activation hook
- Custom Post Type causes Page Not Found
- How can I filter blog name?
- Detect if a plugin was included in a certain page
- How can I make the “Preview Post” button save and preview in the same window?
- Plugin shortcode won’t work on a custom template file [closed]
- XML sitemap over product variations
- How to disable lightbox popup for “add a review” only?
- How do i login when i cant access wp-login.php?
- First WordPress Plugin – Stat Issues
- Adding an Options Page to a Plugin
- Updating the Drag-To-Share eXtended share URLs?
- Send Contact form 7 data to remote server using .NET api [closed]
- Sending HTML emails via wp_mail not working properly
- WP Plugin for onpage link suggestions [closed]
- add_action in static class [closed]
- register_settings callback function posing problem
- Namespaced shortcode?
- }catch (ex){} showing in header [closed]
- Changes not visible when not logged in
- add_query_arg not work in admin
- Api external with wordpress
- profile_update hook doesn’t works inside a class
- Need to revert to an older version of wordpress
- How do I disable Photon on a non-premium WordPress site? [closed]
- Is it possible for a plugin to prevent certain plugins from being installed?
- Activate a plugin via a SQL query
- When I click on Add Product in woocommerce plugin, I get a blank white page [closed]
- Facebook and Twitter share buttons not working [closed]
- Set Button in PluginDocumentSettingPanel Content (WordPress Gutenberg)
- Trouble with AJAX using GET
- Custom Post Type with Sequence ID
- Custom Rewrite Rule Removing Query String
- Link custom post type to page
- How to get Angular app working in WordPress plugin?
- best way to handle subscriptions with a licence?
- ” tag is changed to ” when configuring Cookie Notice
- wordpress form not saving or updating
- Rename wordress plugin
- how to show Author group not Author name
- How can I display a list of only categories which are marked as ‘featured’ in the backend?
- Unexpected plugin_dir_path Output
- Plugin install error: Installation failed: The package could not be installed
- How can I make my plugin display custom post meta data on the front end?
- Metabox Data not saving
- Xml output not places where i want
- What is the RSS feed link for the newest WordPress plugins?
- How can I use multi Media Uploader in a plugin?
- Updates for a private plugin?
- Mixed content warning on doctype in admin
- WordPress woocommerce shipping order [closed]
- List all posts in a particular page [closed]
- WordPress plugin not automatic update
- Free multi dealer rental cars (sign up) [closed]
- is_user_logged_in() undefined at shutdown in plugin context
- What are Seeds? [closed]
- Shortcode cannot parse attributes within double quotes. ” is becoming ” breaking my shortcode