Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create init() function to load script. #28

Open
ydennisy opened this issue Jun 4, 2018 · 1 comment
Open

Create init() function to load script. #28

ydennisy opened this issue Jun 4, 2018 · 1 comment
Labels
optimisation Performance optimisation

Comments

@ydennisy
Copy link
Member

ydennisy commented Jun 4, 2018

Suggestion from @ittus :

<script>
init(someConfig)()
</script>

Which is the pattern followed by https://developers.google.com/analytics/devguides/collection/analyticsjs/

the config object can contain a siteId

@ydennisy
Copy link
Member Author

<script src="https://www.gstatic.com/firebasejs/5.0.4/firebase.js"></script>
<script>
  // Initialize Firebase
  var config = {
    apiKey: "AIzaSyDUWidMFv0hXHfDz-y91mq4zqCnOF7Nbi4",
    authDomain: "pluto-cmp.firebaseapp.com",
    databaseURL: "https://pluto-cmp.firebaseio.com",
    projectId: "pluto-cmp",
    storageBucket: "pluto-cmp.appspot.com",
    messagingSenderId: "691290580347"
  };
  firebase.initializeApp(config);
</script>

@ydennisy ydennisy mentioned this issue Jun 20, 2018
@ydennisy ydennisy added the optimisation Performance optimisation label Jun 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimisation Performance optimisation
Projects
None yet
Development

No branches or pull requests

1 participant