Call: +254 720 362167

ElementsKit Plugin Conflicting With G.A Tracking Code? Fixed

Share on facebook
Share on twitter
Share on linkedin
Share on email

In this Article

Elementskit is the ultimate All-in-one addon for the Elementor page builder. It includes over 40 comprehensive widget modules meant to enhance the power of your page builder. The mega menu builder is particularly helpful when creating custom menus on WordPress. However, the plugin’s header builder seems to conflict with the Google Analytics tracking code.

Google Analytics is a powerful measurement and tracking tool that analyzes and breaks down your traffic. Think of it as a super-advanced Jetpack module. For users who run digital ads and push conversions through the website, Analytics is a must-have tool if you want to accurately measure your ROI.

When using the Elementskit widget addons, you will likely want to use the free Megamenu feature. But to do this, you need to create your header using the plugin’s own header builder. The problem is, the header builder overrides your theme’s header.php file, which is ideally where your Google Analytics tracking code lives.

To continue measuring conversion on your website using GA, you will need to find a way to make the tracking code functional. Luckily, you can still do this without deleting your header template or uninstalling Elementskit plugin altogether. There are 2 ways you can do this.

Add a Hook to your Theme’s Header file

Elementor canvas uses wp_head() to call every function hooked to wp_head.Because ElementsKit header builder overrides your theme’s header file, adding the GA tracking code in the header.php file will not work. Instead, you want to hook your code in the functions.php file as shown below:

add_action( 'wp_head', function(){
    <!-- your code goes here -->

Use Insert Headers and Footers Plugin

The Insert Headers and Footers by WPBeginner is a simple plugin that lets you insert code like Google Analytics, custom CSS, Facebook Pixel, and more to your WordPress site header and footer. No need to edit your theme files!

The simple interface gives you a central place where you can insert scripts, rather than dealing with dozens of different plugins. Simply install and activate the plugin. Then head over to the plugin settings and paste your Google Analytics tracking code under the <head> section. Voila! That’s it!


We typically respond within a few minutes