How do I add HTML markup in body region so it doesn't increase page load time?

by harshal   Last Updated April 16, 2018 09:07 AM

How do I add HTML tags to body?

function hook_page_attachments(&$attachments){
      $attachments['#attached']['html_head'][] = [
        [
         '#type' => 'html_tag',
         '#tag' => 'script',
         '#attributes' => array('src' => 'https://acobot.ai/js/w?key='.$token),
        ],
        'acobot-token',
      ];
}
Tags : 8


Related Questions