<script src="{{site.baseurl}}{{ site.assets_base_url }}js/main.js"></script>
{% if page.custom_js %}
  {% for js_file in page.custom_js %}
  <script src='{{site.baseurl}}/assets/js/{{ js_file }}.js' type="text/javascript"></script>
  {% endfor %}
{% elsif layout.custom_js %}
  {% for js_file in layout.custom_js %}
    <script src='{{site.baseurl}}/assets/js/{{ js_file }}.js' type="text/javascript"></script>
  {% endfor %}
{% endif %}

<!-- Add here more: Google Analytics etc. -->
{% if site.gtm_tracker %}

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
  new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
  j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
  'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
  })(window,document,'script','dataLayer','{{ site.gtm_tracker }}');</script>
  <!-- End Google Tag Manager -->

<script async src="https://cdnjs.cloudflare.com/ajax/libs/autotrack/2.4.1/autotrack.js"></script>

<script src="{{site.baseurl}}{{ site.assets_base_url }}js/cookie.js" async></script>

{% endif %}
