I have settings as below in _config.yml so that I can get tracking information with the help of GA.
# Google Analytics
google_analytics_tracking_id: UA-9118****-2
And this is how I deploy.
What I want to do is to have two different configurations based on the environments where it runs.
For example)
I hope the value of google_analytics_tracking_id on production is UA-AAAABBBB-1 and it is UA-AAAABBBB-2 on localhost.
Are there any approaches to do this without editing the _config.yml manually each time I deploy?
You can use
jekyll.environmentvariable that is set to "development" when you run jekyll locally withjekyll serve, and set to "production" on github pages._config.yml
In your code :