Site icon Hip-Hop Website Design and Development

The best way to add JS script in particular pages in WordPress?

I am new to WordPress, have tried to place the chat bubble JS script into particular pages.
Although I’ve discovered few solutions, however nonetheless cannot totally perceive the way it works.

After I tried to place the code beneath within the theme perform.php.The chat bubble would not present up in any respect.

I’m wondering there’s some error within the code.

Thanks upfront if somebody might help me out with this!

Here is my web site https://staymeander.com/en/meander1948-en/

perform wpb_hook_javascript_footer() {
    if(is_page( array('3854','253') ) ) {
    ?>
        <script sort="text/javascript">
    (perform () {
        var choices = {
            line: "//lin.ee/gl1UqsC", // Line QR code URL
            name: "+886225588812", // Name cellphone quantity
            call_to_action: "Message us", // Name to motion
            button_color: "#FF6550", // Colour of button
            place: "right", // Place could also be 'proper' or 'left'
            order: "line,call", // Order of buttons
        };
        var proto = doc.location.protocol, host = "getbutton.io", url = proto + "//static." + host;
        var s = doc.createElement('script'); s.sort = 'textual content/javascript'; s.async = true; s.src = url + '/widget-send-button/js/init.js';
        s.onload = perform () { WhWidgetSendButton.init(host, proto, choices); };
        var x = doc.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x);
    }   
})();
</script>
    <?php
    }
}
add_action('wp_footer', 'wpb_hook_javascript_footer');