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

  • SEARCH
  • Home
  • 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 7309009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T23:39:14+00:00 2026-05-28T23:39:14+00:00

I have a website say, www.example.com with subdirectories www.example.com/sub1 and www.example.com/sub2 . I have

  • 0

I have a website say, www.example.com with subdirectories www.example.com/sub1 and www.example.com/sub2. I have created 3 profiles in Google Analytics account. ‘General’, ‘Sub1’ & ‘Sub2’. ‘Sub1’ & ‘Sub2’ have filters to only include subdirectories for each. My intention is to get information about hits to my website in ‘General’ profile AND information about hits to specific subdirectory ‘Sub1’ or ‘Sub2’ in the respective profile. I have added this in my JS

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'GOOGLE_ANALYTICS_ID']);
  _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>

Do I need to add anything else in my JS ?

Is there any advantage of including

 _gaq.push(['_setDomainName',  '.example.com']);
  _gaq.push(['_setCookiePath', '/Sub1']); 

in my JS ? I went through Google Analytics documents but could not find advantage of using this, if I have already defined filters in my account. Please shed some light on it.

  • 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-05-28T23:39:15+00:00Added an answer on May 28, 2026 at 11:39 pm

    Neither _setDomainName or _setCookiePath are needed in your case.

    _setDomainName is only needed if you’re dealing with multiple domains and/or subdomains, like www.example.com, sub1.example.com, www.example2.com, etc.

    _setCookiePath allows tracking of multiple distinct sites on a domain, but makes the general rollup tracking more difficult.

    Google Analytics uses cookies to track things like session status, referral data, etc.
    Normally, root (/) is used as the default cookie path for an entire site. If you try using setCookiePath to set different paths for different parts of your site, the tracking data is going to be inconsistant across the whole site.
    Since you have one site, but want different views of the data, only one cookie path is needed, and the default path will work.

    FYI: Filters in Google Analytics are not retroactive — they only apply to new tracking data coming in, not data that’s already been recorded.

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

Sidebar

Related Questions

I have a website, lets say: http://www.example.com/ I'm using rewrite module, but I have
I have a website let's say www.example.com and I have a subdomain something.example.com Both
Let's say I have a website with domain: www.example.com If I set a cookie
Say I have the website http://www.example.org and the corresponding Facebook page at http://www.facebook.com/example .
Say I have a website www.example.com . Under the website directory there is a
Let's say I have a url such as... http://www.example.com/ random-garbage-here-i-dont-want-12392 /video 2983439 Is there
I have a webpage (say www.example.com/a.asp) .. I am having an iframe in this
I actually have two websites on the same domain. say, for example http://www.abc.com/flashsite &
I have a website say www.livesite.com which is currently running. I have been developing
I have a website say www.mywebsite.com/demo . When ever if anyone requests this site,

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.