Releases: butschster/LaravelMetaTags
Releases · butschster/LaravelMetaTags
Removed closing tags
Merge pull request #21 from Hladenkyi/master Removed closing tags
Fixed problem with wrong og meta tags
Fixed issue #17
v1.6.7
fix
Removed deprecated trait Illuminate\Console\DetectsApplicationNamespace
Added support for Laravel 7.*
Merge pull request #13 from nguyentranchung/patch-1 Support laravel 7.x
Separate Google analytics into Analytics and Tag manager
Google Analytics
Has header placement!
use Butschster\Head\MetaTags\Entities\GoogleAnalytics;
$script = new GoogleAnalytics('UA-12345678-1');
Meta::addTag('google.analytics', $script);
Will return
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-12345678-1', 'auto');
ga('send', 'pageview');
</script>
Google TagManager
Has header placement!
use Butschster\Head\MetaTags\Entities\GoogleTagManager;
$script = new GoogleTagManager('UA-12345678-1');
Meta::addTag('google.tagmanager', $script);
Will return
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-12345678-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-12345678-1');
</script>
Google Analytics tag
Google Analytics
Has header placement!
use Butschster\Head\MetaTags\Entities\GoogleAnalytics;
$script = new GoogleAnalytics('UA-12345678-1');
Meta::addTag('google.analytics', $script);
Will return
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-12345678-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-12345678-1');
</script>
Added Yandex metrika script builder
Yandex Metrika
Has footer placement!
use \Butschster\Head\MetaTags\Entities\YandexMetrika;
$script = new YandexMetrika('20925319');
Meta::addTag('yandex.metrika', $script);
Will return
<script type="text/javascript">
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
ym(20925319, "init", {clickmap:true,trackLinks:true,accurateTrackBounce:true,webvisor:true});
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/20925319" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
Change clickmap setting
$script = new YandexMetrika('20925319');
$script->clickmap(bool);
Change webvisor setting
$script = new YandexMetrika('20925319');
$script->webvisor(bool);
Change trackLinks setting
$script = new YandexMetrika('20925319');
$script->trackLinks(bool);
Change accurateTrackBounce setting
$script = new YandexMetrika('20925319');
$script->accurateTrackBounce(bool);
Change trackHash setting
$script = new YandexMetrika('20925319');
$script->trackHash(bool);
Change eCommerce setting
$script = new YandexMetrika('20925319');
$script->eCommerce(string $containerName);
Use alternate CDN
$script = new YandexMetrika('20925319');
$script->useCDN();
Disable noscript tag
$script = new YandexMetrika('20925319');
$script->disableNoScript();
- Fixed bug with yandex metrika noscript part
v1.4.2
Removed attribute value encoding #5
Fixed problem with using console commands
v1.4.1 Fixed problem with running unittests and ide-helper commands #4 #3