I'd like to test meteor google analytics package on a remote server.
settings.json
{
"public" : {
"ga": {
"account":"UA-dfgddhdh-5"
}
}
}
In a local server, I just pass in --settings
option. I looked at http://meteorpedia.com/read/Environment_Variables and http://docs.meteor.com/#/full/meteor_settings but it's still unclear what I should do to set this environment variable inside meteor deploy
. Thank you for your help!
EDIT:
if (Meteor.isServer) {
Meteor.startup(function () {
var settings = JSON.parse(
'{"public" : {"ga": {"account":"UA-5555555-5"}}}'
);
process.env.METEOR_SETTINGS = settings;
});
}
Is this the right approach? Also, https://github.com/datariot/meteor-ganalytics package requires this setting before the package itself is loaded. How do I ensure it?
You can use, on the server side:
process.env.ENV_VARIABLE = "something"
instead of $ export ENV_VARIABLE='something'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With