Google Anlytics; hardcoding or using a plugin?
Hello WordPress.org Community,
I’m new to WP and still exploring and learning many of its aspect.
I run a (very) small blog that I want to monitor using GA (unless there is another recommendation). I pretty much know how to connect the blog to GA, but I have one question that I hoped that you could help me with: should I hardcode the GA ID into the theme or should I use a plugin?
Basically, whenever it makes sense I usually prefer to hardcode or edit the WP/Theme files over using plugins to achieve the required functionality. I learn a lot from it, and although I might be wrong, I assume that it reduces the security risk and the overall dependability on the plugin’s continued maintenance.
When it comes to GA I’m not so sure how to go about it. I assume that a plugin adds the GA ID even when switching themes (I’m still experimenting with the look and feel so I’m going back between themes now and again), while in the manual approach I would need to remember to add it with each theme change.
I would appreciate any recommendation.
Also, in case I will hard code it, where should I insert the code into? The header.php or the footer.php (I read mixed opinions)?
- The topic ‘Google Anlytics; hardcoding or using a plugin?’ is closed to new replies.