Disqus GTM Event Listener
Track Disqus comment widget interactions in GTM. Monitor new comment submissions, comment loads, and upvotes with the disqus_comment custom event.
disquscommentscontentgtmga4engagementcommunity
Event fired
disqus_commentDisqus
Overview
Disqus is a widely-used blog commenting platform. This listener hooks into Disqus's JavaScript callback system to track comment submissions and engagement events.
Event fired: disqus_comment
Common Use Cases
- Track comment submissions as engagement conversions in GA4
- Measure content engagement depth (page views vs. comments)
- Build audiences of users who commented for retargeting
- Correlate content comments with other conversion events
Tracked Events
| Event | Description |
|---|---|
disqus_comment | User submits a new comment |
disqus_thread_loaded | Comment thread loads |
disqus_reaction | User reacts to a comment |
Installation
html
<!-- GTM Custom HTML Tag: Disqus Listener -->
<script>
(function() {
function disqusPush(eventName, extra) {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push(Object.assign({ 'event': eventName }, extra || {}));
}
var initDisqus = function() {
if (typeof window.DISQUS === 'undefined') return;
DISQUS.on('ready', function() {
DISQUS.on('newComment', function(comment) {
disqusPush('disqus_comment', {
disqusCommentId: comment.id,
disqusAuthor: comment.author && comment.author.username,
disqusThread: comment.thread
});
});
});
};
window.addEventListener('load', initDisqus);
})();
</script>Data Layer Output
json
{
"event": "disqus_comment",
"disqusCommentId": "comment_12345",
"disqusAuthor": "username123",
"disqusThread": "post-title-abc"
}Trigger Configuration
Trigger: Custom Event | disqus_comment
GA4 Mapping
| GA4 Event | Parameters |
|---|---|
comment | thread_id, method: "disqus" |