adding google analytics code example

Example 1: set up google analytics

How to set up Google analytics:

Watch this video: https://www.youtube.com/watch?v=lZf3YYkIg8w

Or Click on this link: https://support.google.com/analytics/answer/1008015?hl=en

Example 2: add google analytics to website laravel

@if(\Settings::get('google_analytics_id'))
    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async
            src="https://www.googletagmanager.com/gtag/js?id={{ \Settings::get('google_analytics_id') }}"></script>
    <script>
        window.dataLayer = window.dataLayer || [];

        function gtag() {
            dataLayer.push(arguments);
        }

        gtag('js', new Date());

        gtag('config', "{{ \Settings::get('google_analytics_id') }}");
    </script>
@endif

Tags:

Php Example