0

My customer bought a project prepared with Yii. I met with Yii and Everything is perfect. I have a small problem and I didn't find any solutions yet. I have seo tracking script with core php. I must add my code in view/main.php

<script id="domain" data-name="6208315" type="text/javascript" src="https://domain/seo/js/analytics_js/client.js"></script>

But I didn't find any solutions, how can i add this code for my main.php. Generally Usually added this code in footer.php for core php projects.

I hope you can help me about this problem. Thank you.

kocero
  • 1

1 Answers1

0

Open file with -Assets suffix in assets/ folder (usually AppAsset.php) and add your js file in $js var:

public $js = [
     // ...
     'https://domain/seo/js/analytics_js/client.js',
];
Fabrizio Caldarelli
  • 2,982
  • 11
  • 14
  • Thank you for solution. But this doesn't work for me. I must add id="domain" data-name="6208315" values for external script. – kocero May 22 '17 at 15:33