How to Add Custom JavaScript Code to Google Analytics Tracking

Do you need to add some custom JavaScript to your ExactMetrics Google Analytics Tracking?

You can easily add JavaScript through a setting or option in your WordPress theme (if applicable) or you can use a plugin called Insert Header and Footers.

In both cases, you’ll want to insert custom JavaScript code into the header of your WordPress site.

If you’re using the Insert Header and Footers plugin, you can follow this guide to learn how to quickly insert custom code.

Step 1: While logged into your WordPress site, if don’t already have it, please install the Insert Header and Footers plugin.

Insert Headers and Footers Settings

Step 2: In the Scripts in Header setting, insert your custom JavaScript code. Click Save.

Please note that this is only for JavaScript and not for PHP code.

You did it! You learned to insert your custom JavaScript code to extend your Google Analytics tracking!

What’s next? Learn how to set up Custom Dimensions with ExactMetrics: How to Set Up Custom Dimensions.