Hubspot Live Chat on Tag Manager

Highlighted
New Contributor

<script type="text/javascript">
function onConversationsAPIReady() {
//console.log("HubSpot Conversations API Available");
window.HubSpotConversations.on( 'conversationStarted', function( payload ) {
//console.log("HubSpot Conversation Started");
window.dataLayer.push({
'event': 'hubspot-conversation-started',
'hs-conversation-id': payload.conversation.conversationId
})
});
}
/*
If external API methods are already available, use them.
*/
if (window.HubSpotConversations) {
onConversationsAPIReady();
} else {
/*
Otherwise, callbacks can be added to the hsConversationsOnReady on the window object.
These callbacks will be called once the external API has been initialized.
*/
window.hsConversationsOnReady = [onConversationsAPIReady];
}
</script>

 

 

 

Hi,   This script is not wokring for me. Im using this wordpress plugin to intergrate the chat widget. https://wordpress.org/plugins/leadin/ I tried adding the script through the tag manager as well as through the theme. But none of them working.

Reply
0 Upvotes
5 Replies 5
Highlighted
Community Manager

Hi @TomShakir 

 

I wanted to tag in some subject matter experts here.

@Kevin-C , @stefen and @psdtohubspot , could you share your advice for @TomShakir ?


日本語版HubSpotコミュニティーがあるのをご存知ですか?
言語設定を変更してアクセスしてみましょう!

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !


Reply
0 Upvotes
Highlighted
Regular Advisor | Partner

Thanks @natsumimori 

 

Hey @TomShakir 

 

Might you be able to post a live link so we can see the issue in action?

Also what methods of testing have you tried so far?

Highlighted
New Contributor

Thank you @natsumimori 

@Kevin-C  This is the live site url - https://surreyplumbers.co/

Currently I have added the script through tag manager. In tag manager preview I can see the script is triggering and it shows the first console.log "HubSpot Conversations API Available". But still the event is not triggering.

 

But without the preview mode. I cannot see even the first console log to troubleshoot the issue. Please help me.

 

 

 

Reply
0 Upvotes
Highlighted
Regular Advisor | Partner

Hey @TomShakir Unfortunately I was unable to debug. Did you get it working?

 

Maybe one of these articles has the answer:

Reply
0 Upvotes
Highlighted
New Contributor

@Kevin-C It is the plugin I am using and but still I did not able to make the script work. 

Reply
0 Upvotes