Variables inside JavaScript

How would it work with such a code? I want {{ . }} to be picked up by the JS.

{{- with site.Params.google.analytics }}
<script >
window.minimalAnalytics = {
  trackingId: '{{ . }}',
  autoTrack: true, // <-- init tracking
};
</script>
{{- end }}

Edit: This worked. But I am still interested to know if/how the @params method would work.