check if google analytics is defined before initializing plugin to avoid errors