Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9171525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:10:29+00:00 2026-06-17T16:10:29+00:00

How to track urls in iframes with Google Analytics? What I do is that

  • 0

How to track urls in iframes with Google Analytics?

What I do is that I put this code inside the iframe, like I do on the "top" window.. But the iframe isn’t tracked in analytics?

This should work, but it doesn’t.. 🙁

iframe

<html>
    <head>
        <script type="text/javascript">
            var _gaq = _gaq || [];
            _gaq.push(['_setAccount', 'UA-35706930-1']);
            _gaq.push(['_trackPageview']);
            
            (function() {
                var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
            })();
        </script>
    </head>
    
    <body></body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:10:30+00:00Added an answer on June 17, 2026 at 4:10 pm

    at face value, there’s no reason it shouldn’t work. But GA will track based on the iframe URL, not the parent URL, so if the iframe is hosted on some other domain, you may have problems, depending on your settings within GA. Check to make sure you are using the right account #. Check to make sure you don’t have any profile filters (such as an ‘include only xyx.com’ domain) or anything else in your settings that exclude domains, etc..

    Also note that if the iframe is on a different domain, you’re going to run into issues with tracking in general as far as session and visit(or) metrics. In order to get around this, you will need to implement additional cross-domain tracking. Not having this would not cause NO data to show up, so this in and of itself isn’t the root issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to track down an issue in our MFC code that looks like
I have this problem where all URLs like context/path/file/anything/that/follows becomes context/path/file.php/anything/that/follows or context/path/file.xml/anything/that/follows .
I would like to track the link that a user followed to reach my
In a web-crawler of mine, I have a class that keeps track of urls
I'm trying to track the memory usage of a script that processes URLs. The
I'm just starting out with Google Analytics. Im trying to create a report that
We are attempting to track offline campaigns to using aliased URLs that point to
I'm trying to get Google Analytics to track the specific link in the page
I tried to set up a playlist with jPlayer, like this demo shows. You
Have I missed any obvious things that you can log to keep track on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.