The plugin isn’t required to do any of it, it just makes it easier to work with embed codes and ensures Javascript is properly enqueued. I’m not sure why you would need a custom shortcode beyond what the plugin provides.
I do not recommend adding your tracking code to the <head> section, and it probably shouldn’t be directly in the header.php file. As the plugin does, you should enqueue your Javascript using WordPress’s built-in functionality so that it’s printed—in proper order—in the footer.
@cliffseal Thank you for the quick reply! Great, we will look to remove the plugin from our WordPress instance. Just out of curiosity, why do you recommend adding the tracking Javascript in the footer?
All of our Google tags have been specified to be added to the header.php file, so that they accurately fire before other Javascript on pages. Also, Google Tag Manager, which we are implementing soon, is also inserted within the header.
Thanks!
-Hank
Google always wants its stuff in the <head> to ensure it records the visit as soon as possible.
Specifically in WordPress, it’s generally advised to use the built-in enqueuing system so that you can manage dependencies properly (e.g. ensure jQuery is loaded before script x). And since WordPress doesn’t make Javascript async by default, it’s smart to load non-critical scripts before the closing </body> tag to get your page loaded faster for visitors.
@cliffseal Got it, that makes sense. Thank you for all of this great information!