How do I track HTTP and HTTPS in Google Analytics?

  • Not a member? Join our community and get access to all private sections on this forum.
    (free membership ends in 7hrs 15mins)
    BlackHatNaija Countdown Timer

    “BlackHatNaija-Register
Web Hosting

Bitcoin

Active member
Dec 22, 2017
653
81
28
#1
You need to set up cross-domain tracking in Google Analytics.
Follow the linked instructions to do the following:
  • Set up a master profile for your primary domain without filters.
  • Create a profile especially for cross-domain tracking and re-use your tracking code.
  • Modify your cross-domain profile with a filter to show the full domain in your content reports.
In reference to the comment - "my main issue comes from http -> index.php and https -> index.php being recognized as the same page":

Here are some things you can try to differentiate between http://www.example.com/index.php and https://www.example.com/index.php (two separate pages):

  • Rename the https index.php to something else (e.g. index-cart.php). This is probably the best/easiest thing to do.
  • Rename the http index.php to something else and set as the default document (e.g. default.php). This might be quite easy as your are probably referencing the site root just with href="/"
  • Alias the https www subdomain to something else (e.g. https://checkout.example.com). This is just a DNS change, and hopefully a simple change to your config file to point to the new secure alias. This will allow you to do cross-domain tracking exactly as per the Google documentation.
  • Add a parameter to your links to the secure pages (e.g. href="https://www.example.com/index.php?foo=bar". This would allow you to differentiate between the two index pages in GA. This is not the best option but should be easy to implement without breaking any business logic.
Hope this helps. Please report back on any methods which work for you.
Cross-Domain Tracking in Google Analytics: *Tracking Multiple Domains - Web Tracking (ga.js)

source: Google Analytics: How can I track between http:// and https:// profiles for a domain?
 

Today's Featured Posts

Our Facebook