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
- No Google Analytics code rendered in the header?
- Background Music WP [closed]
- How to fix broken media library?
- WordPress failing to update plugins
- Image tooltip enable/disable
- Using custom fields for image alt and title
- DB Query not working in Plugin
- Remove Pagination for Product Category Pages WooCommerce
- Is there a plugin or a way in the wordpress that would let us have different versions of a post or page accessibe to users?
- Error trying to update plugins
- Get all the URLs of the pages that uses a specific shortcode
- WordPress permissions error with admin account
- Deactivation Hook does not remove database
- Looking for Gallery Plugin [closed]
- How to accept images at multiple sizes and aspect ratios and display as standardized image size / ratio?
- Notice: Undefined index: mtral_field_subscriber
- Why is my WordPress Plugin page requesting my FTP Login Credentials?
- Delete free version plugin will also delete premium plugin
- add seperate suffix for low price and high price in woocommerce
- WordPress Editor completely blank [closed]
- Moving FB comments at the end of page
- Change the layout of action links under the plugin names
- Assign all Post in Wp to a specific Category
- How can i add simple code in only in posts by function.php
- Passing Parameters from shortcode to enqueue script
- Get products list by url key in WordPress Woocommerce [closed]
- URL rewrite with external JSON query
- Cross Sells are not being shown in Cart Page. Please Help!
- Possibility to login without password
- How to display registered customer list as dropdown in WooCommerce checkout?
- Using custom php file for ajax url inside plugin
- How do I create a custom permalink structure for a page template
- How do I get the Payzone WooCommerce payment gateway plugin to show up in the settings? [closed]
- simple-job-board Plugin throws an error on live server [closed]
- Where Should i write the code for wordpress ajax voting?
- How to remove a class function from a plugin by using remove_action()?
- Sending HTML email containing custom fields to site users from WordPress
- How to get images using taxonomy ( WP Media Folder)
- Plugin – Admin menu page broken url
- Error with get_price (and others) in self-written plugin to show price
- Hide DIV if empty – Plugin Gallery
- Easy WP SMTP plugin test email failed
- How to modify or create custom contact form 7 select options [closed]
- How to update a local development plugin on a separate machine
- adding Adsense’s In-Article Ads between images of blog post
- How to Include Fields in Query String When Making Request of WordPress.org Plugin API?
- Custom plugin – load enqueue only for this plugin
- Export postmeta (custom fields)
- Creating a form and displaying entry data as a table
- Which filter/action should I use to serve content for “virtual” files
- Customizing a blog page layout
- Add “Featured Image” box in my plugin post page
- Error When Trying To Login [closed]
- Is it a standard to have an empty `index.php` in root of Plugin? [duplicate]
- unable to remove malware from wp website [closed]
- Sub Plugin deactivation when Parent Plugin deactivate
- Getting 400 Error: redirect_uri_mismatch when trying to grant permission to Gmail SMTP plugin
- How to change WooCommece variation data programmtically [closed]
- Managing wordpress Themes & plugins for multisite
- WordPress Fatal Errors [closed]
- Getting a ressource ID, from a WC_Order_Item_Product/Order
- Chrome Dev Tools console says every page in my blog has link to http://maps.google.com [closed]
- Minimize and Uglify WordPress Plugin Files
- YOAST Seo xmlsitemap menu item not showing in the dashboard [closed]
- Regularity of Checking for plugin updates? [duplicate]