Load Javascript iframe chat after image click. Facebook customer chat plugin

I have been using Customer Chat Plugin for Facebook which can be found here
https://developers.facebook.com/docs/messenger-platform/discovery/customer-chat-plugin/

The problem is the size of the chat is +1mb and can take upto 10 seconds to load.

My idea is to use a static floating image for page load. then have the chat load only once the image has been clicked.

This is the script we have in our head, and the one that needs calling only on image click.

Can anyone tell me if this is possible.

I wish I knew more JavaScript, I’m praying someone has already achieved this. I just think its crazy to load a +1mb js on every page when not everyone will use it.

Any help is much appreciated.

Read more here:: Load Javascript iframe chat after image click. Facebook customer chat plugin

Leave a Reply

Your email address will not be published. Required fields are marked *