How to Add Google Analytics to Elementor
You’ve poured your effort into crafting a beautiful website with Elementor, dragging and dropping your way to a design that perfectly represents your brand. But now comes the big question: is anyone actually seeing it? Simply launching a site isn't enough, you need to understand who your visitors are, where they're coming from, and what they do once they arrive. This is exactly what Google Analytics is built for, and this guide will show you how to connect it to your Elementor site step-by-step.
We'll walk through the entire process, starting with how to get your unique tracking code from Google. Then, we’ll cover three straightforward methods for adding it to your WordPress site, from the easiest plugin-based approach to using Elementor Pro’s built-in features.
First, a Quick Refresher: Why Connect Google Analytics at All?
Before jumping into the "how," it's worth remembering the "why." Connecting Google Analytics isn't just a technical task to check off your list, it's the key to unlocking valuable insights about your website's performance. When you have this data, you can stop guessing and start making informed decisions.
With Google Analytics, you can answer questions like:
- How many people are visiting my site? Track daily, weekly, and monthly traffic trends to see your audience grow over time.
- Where are my visitors coming from? Find out if your traffic is originating from Google search, social media, email newsletters, or other websites.
- What content is most popular? See which pages and blog posts get the most views, so you know what resonates with your audience and what you should create more of.
- Are my marketing efforts working? If you're running ads or posting on social media, you can track whether those campaigns are actually sending traffic to your site.
- Who is my audience? Get anonymous demographic data, such as your visitors' age ranges, gender, and geographic locations.
Essentially, it’s the difference between flying blind and having a clear dashboard for your website’s activity.
Getting Your Google Analytics 4 Measurement ID
To connect your Elementor site to Google Analytics, you first need a small piece of information: your Measurement ID if you're using a plugin, or the full Global Site Tag if you're adding it manually. Your Measurement ID is a unique identifier that looks something like G-XXXXXXXXXX. Let’s get that now.
If you already have a Google Analytics 4 property set up, you can skip to step 5 to grab your ID. If you’re brand new, start from the top.
- Create a Google Analytics Account Go to the Google Analytics website and sign in with your Google account. Click on the “Start measuring” button.
- Set Up your "Account" This is the highest level of your GA hierarchy. For the "Account name," just enter your business or brand name. Review the data sharing settings and click "Next."
- Create a "Property" A property represents your website or app. Give it a name - typically, your website's name. Select your reporting time zone and currency, then click “Next.” You'll be asked a few optional questions about your business, answer them and click "Create."
- Set Up a "Data Stream"
A data stream is a source of data for your property. Since you’re tracking a website, choose the “Web” platform. Enter your website’s URL (e.g.,
www.yourwebsite.com) and give the stream a name (again, your website name works perfectly). Click “Create stream.” - Find and Copy Your Measurement ID or Global Site Tag After creating the stream, you'll land on the "Web stream details" page. At the top right, you'll see your Measurement ID (starting with 'G-'). If you plan to use a plugin (Method 1), this is all you need - copy it and save it for later.
Now that you have your tracking information, it's time to add it to Elementor.
Method 1: The Easy Way with a Plugin (Recommended)
For most users, especially if you’re not comfortable editing code, a plugin is the safest and simplest solution. You won't have to worry about accidentally breaking your site or having your code overwritten when you update a theme. Our top recommendation is Site Kit by Google, as it's the official plugin from Google for its various services.
Step 1: Install and Activate Site Kit by Google
- In your WordPress dashboard, navigate to Plugins > Add New.
- In the search bar, type "Site Kit by Google."
- Find the plugin, click "Install Now," and then click "Activate" once it’s installed.
Step 2: Connect Your Google Account
- After activation, you’ll see a prompt to begin the setup. Click "Start Setup."
- It will ask you to sign in with your Google account - the same one you used to create your Google Analytics property.
- Follow the on-screen prompts to grant Site Kit permission to access your Google account data. It will automatically verify you own the website domain.
Step 3: Connect Google Analytics
- Once your site is verified, Site Kit will offer to connect other services. Google Analytics should be one of them.
- Click "Connect Service" for Analytics. The plugin will find the GA4 property you already created.
- Select the correct Account and Property from the dropdown menus and click "Configure Analytics."
And that’s it! The plugin handles adding the tracking code to your site's header automatically. The best part is that Site Kit also pulls key traffic metrics directly into a dashboard within WordPress, so you can see your performance without even leaving your site.
Method 2: Using Elementor’s Custom Code Feature (Elementor Pro required)
If you're already an Elementor Pro user, you have a powerful feature that makes adding code snippets like a Google Analytics tag incredibly simple: Custom Code. This method keeps your snippets neatly organized inside Elementor without needing an extra plugin.
Note: This feature is only available in Elementor Pro. If you are using the free version, please stick with Method 1 or 3.
Step 1: Go to the Custom Code section in Elementor
- From your WordPress dashboard, go to Elementor > Custom Code.
Step 2: Create a New Code Snippet
- Click the “Add New” button at the top of the page.
- Give your new code snippet a descriptive title, like “Google Analytics Tag” or “GA4 Tracking.”
Step 3: Add Your Tracking Code
- In the main code box, paste the full Global Site Tag (gtag.js) you copied earlier from your Google Analytics data stream. The snippet looks like this:
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [],
function gtag(){dataLayer.push(arguments),}
gtag('js', new Date()),
gtag('config', 'G-XXXXXXXXXX'),
</script>Step 4: Configure the Settings
- Location: For Google Analytics tracking code to work correctly, it needs to be in the
<head>section of your website’s HTML. In the "Location" dropdown, select "<,head>,". - Priority: You can leave this as 1.
- Click the “Publish” button.
Step 5: Set Your Display Conditions
- A final window will pop up asking where you want this code to appear. You want Google Analytics to track all pages of your website.
- By default, it will be set to "Entire Site." This is what you want. Click "Save & Close."
Your Google Analytics tracking code is now active across your entire Elementor website.
Method 3: Adding the Code via Your Theme Customizer
Many modern WordPress themes — especially those popular with Elementor users like Astra, GeneratePress, or OceanWP — include a built-in feature for adding scripts to your site's header or footer. This can be a good alternative if you don’t have Elementor Pro and want to avoid installing another plugin.
The exact location of this feature will vary from theme to theme, but the process is generally similar.
How to Find it:
- In your WordPress dashboard, navigate to Appearance > Customize. The WordPress Customizer will open.
- Look for a menu option with a name like “Header,” “Site Settings,” “Additional JS/CSS,” or “Scripts.” You may need to poke around a bit. Sometimes it's nested under "Layout" or "Theme Options."
- Inside, you’ll likely find a text box labeled “Head Scripts,” “Header Scripts,” or "wp_head".
- Paste your full Global Site Tag (gtag.js) snippet into that box.
- Click the “Publish” or “Save” button to make your changes live.
While this method works well, be aware that if you ever switch your theme, you will need to remember to move this code snippet to your new theme's settings.
How to Verify Your Google Analytics Tag Is Working
After you’ve added the tracking code using one of the methods above, you should always confirm that it’s working. Don't just assume everything is connected correctly!
Google Analytics provides a very simple way to do this with its Realtime report.
- Log in to your Google Analytics account and navigate to the property you just set up.
- In the left-hand menu, go to Reports > Realtime. This report shows you website visitors who are active within the last 30 minutes.
- In a different browser tab or on your phone, open your website. Visiting in an incognito or private browsing window is a good idea to make sure you’re not filtered out as a logged-in admin.
- Now, look back at your Realtime report in Analytics. In under a minute, you should see the number of "Users" jump to 1. The map may also show your geographic location.
If you see your visit register, congratulations! You have successfully added Google Analytics to your Elementor site. It can take up to 48 hours for data to fully populate in the standard reports, but the Realtime view gives you immediate confirmation that things are working.
Final Thoughts
Adding Google Analytics to your Elementor site is a fundamental step toward growing your online presence. Whether you choose the user-friendly approach of a plugin like Site Kit, use Elementor Pro's powerful Custom Code feature, or leverage your theme’s built-in options, you’re now equipped to collect the data you need to understand your audience and make smarter decisions for your website.
Once you start collecting data in places like Google Analytics, the natural next step is to connect it with information from your other tools like Google Ads, Shopify, or HubSpot. Normally, that process involves hours of manually crunching numbers in spreadsheets to see the full picture. When this becomes your challenge, we built Graphed to simplify it entirely. You can connect your marketing and sales data sources with a few clicks, then ask for dashboards or reports in simple, natural language. It helps you get from raw data to actionable insights in seconds, not hours.
Related Articles
What SEO Tools Work with Google Analytics?
Discover which SEO tools integrate seamlessly with Google Analytics to provide a comprehensive view of your site's performance. Optimize your SEO strategy now!
Looker Studio vs Metabase: Which BI Tool Actually Fits Your Team?
Looker Studio and Metabase both help you turn raw data into dashboards, but they take completely different approaches. This guide breaks down where each tool fits, what they are good at, and which one matches your actual workflow.
How to Create a Photo Album in Meta Business Suite
How to create a photo album in Meta Business Suite — step-by-step guide to organizing Facebook and Instagram photos into albums for your business page.