Skip to content

script tag in index.htmlΒ #90

@matthias-k

Description

@matthias-k

Hi,

we are in the process of enabling our ember app for fastboot. So far it works very well when using ember serve, but it's not yet working with fastboot-app-server: We have a script tag in our index.html to load google analytics as suggested from google at https://developers.google.com/analytics/devguides/collection/analyticsjs/

<!-- Google Analytics -->
<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-XXXXX-Y', 'auto');
</script>
<!-- End Google Analytics -->

When using ember server we can then later on access the ga object as window.ga but when accessing the page via fastboot-app-server, this results in TypeError: window.ga is not a function. Can you help me fix this or just indicate where I missed something in the docs? I would be very grateful for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions