q2a - add script into head

0 votes
186 views
added May 3, 2023 in Javascript by lcjr First Warrant Officer (11,850 points)

Edit the following file source: /public_html/YOURSITE/qa-theme/SnowFlat/qa-theme.php

And add the scripts into: 

public function head_metas()
{
  $this->output('<meta name="viewport" content="width=device-width, initial-scale=1"/>');
  $this->output('<meta property="fb:app_id" content="xxxxxxxxxxx" /> '); 
  $this->output('<script async src="https://www.googletagmanager.com/gtag/js?id=x-xxxxxxxxxx"></script>');
  $this->output('<script>');
  $this->output('  window.dataLayer = window.dataLayer || [];');
  $this->output('  function gtag(){dataLayer.push(arguments);}');
  $this->output("  gtag('js', new Date());");
  $this->output("  gtag('config', 'x-xxxxxxxxx');");
  $this->output('</script>');
  qa_html_theme_base::head_metas();
}

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...