inject google analytics to html files with bash

In some cases you create static html/htm file away from whatever CMS you may use (Wordpress – Joomla – Drupal) so your google analytic code “javascript” need to be inject manually.
In case like this and when you have many html/htm files you can use this script to automatically insert google code to them
Pleas take care from the following point:
1- Change TRACKER_ID to be Your
2- Edit the script to meet your need for example if your file have extension htm/html .. etc
3- Backup the original html/htm files

More »