Disqus Event Listener
How to track Disqus Interaction with google tag manager
You can measure when users leave a comment in your Disqus comment section and have the data pushed to your analytics tools (Google Analytics, Piwik Pro, Heap, Mixpanel, etc.), using Google Tag Manager and the Disqus event listener.
To implement this copy the Disqus event listener code, create a new custom HTML tag in Google Tag Manager, paste the code here and apply these customizations;
// this.page.url = ‘{{Page URL}}’; // Replace PAGE_URL with your page’s canonical URL variable
change {{Page URL}} to the canonical page URL
this.page.identifier = ‘0123456789’; // Replace PAGE_IDENTIFIER with your page’s unique identifier variable
change ‘0123456789‘ to the page identifier
Save your tag and fire on DOM or Window Loaded (Recommended)
The creator of the code is Isaac Abramowitz and can be found here
<script> var disqus_config = function () { this.page.url = '{{Page URL}}'; // Replace PAGE_URL with your page's canonical URL variable this.page.identifier = '0123456789'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable this.callbacks.onNewComment = [function() { window.dataLayer = window.dataLayer || []; window.dataLayer.push({ 'event': 'disqus_comment' }); }]; }; </script>