CMS Development

someshwar
Teilnehmer/-in

Live chat is not working on AMP-first Wordpress blog

Hi,

 

Live chat is not working on our Wordpress blog https://globemoving.net/blog/.

 

We are using AMP plugin. So it is AMP-first.  If I disable the plugin, the chat is showing.

 

I tried with/without Hubspot plugin installed. You can check the code in the front-end and in the back-end.

 

front-endfront-endback-endback-end

and when AMP disabledand when AMP disabled

I think AMP is blocking the code. Do you have a solution for this?

 

Thanks

0 Upvotes
6 Antworten
arturskruze
Mitglied

Live chat is not working on AMP-first Wordpress blog

Hey.

 

This is Arturs from Magebit. We have an AMP website ourselves and stumbled upon this issue also.

 

AMP doesn't really allow custom javascript code. Therefore, live chats on AMP are tricky. It is possible to apply for developer mode where you are able to write limited javascript on your site but I think it will still not be enough to use HubSpot's live chat module properly.

 

Unless HubSpot releases an AMP version of the live chat, I don't see a way to get AMP and their live chat to working together.

 

I've seen AMP + live chats (i.e. facebook live chat on AMP sites) so it is possible. Just not with HubSpot for now. Hopefully, they will come up with an AMP live chat soon 🙂

 

Cheers

0 Upvotes
thekizoch
Mitglied

Live chat is not working on AMP-first Wordpress blog

Hi!

 

Just wished to ask if you knew what the implementation was for AMP + live chat. I'm keen to deploy it using any Saas or module.

 

Thanks for your help,

 

Michael

0 Upvotes
tjoyce
Trendsetter/-in | Elite Partner
Trendsetter/-in | Elite Partner

Live chat is not working on AMP-first Wordpress blog

@someshwar  - First, I would ensure that you can actually put script tags and javascript code in the place where you are putting that HS embed code. I'm not exactly sure from the screenshot, which file you have your embed code in, or if it's a plugin like "Simple Custom CSS / JS" that let's you inject code. 

 

So, first step to debug is to replace your HS code with this code - 

<script>alert();</script>

If you see a popup appear on the page, then you know the problem is most likely the script source. 

 

If the alert() happens, next I would try injecting the HS code dynamically with this code:

<script>
var script = document.createElement('script');
script.src='https://js.hs-scripts.com/6244164.js';
script.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(script);
</script>

If the alert() didn't happen, I would try using a plugin like the one I mention above. 

https://wordpress.org/plugins/custom-css-js/

someshwar
Teilnehmer/-in

Live chat is not working on AMP-first Wordpress blog

Hey @tjoyce,

 

thanks for the response. I replaced the HS script with <script>alert();</script> popup is not appearing.

 

I tried with "Simple Custom CSS / JS" plugin too. Not working.

 

 

0 Upvotes
tjoyce
Trendsetter/-in | Elite Partner
Trendsetter/-in | Elite Partner

Live chat is not working on AMP-first Wordpress blog

I notice you have a cache plugin. Did you make sure when you used the custom CSS plugin that the cached version wasn't being delivered? Can you disable the cache while you're in development?

 

cache.png

0 Upvotes
someshwar
Teilnehmer/-in

Live chat is not working on AMP-first Wordpress blog

@tjoyce,

 

I disabled the cache plugin and check. Still the same. Not showing.

0 Upvotes