Move ga script into includes and improve semantics