Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Tracking User Interactions in Google Analytics for a Website Opened via an iFrame from a Captive Portal

    Scheduled Pinned Locked Moved Captive Portal
    3 Posts 3 Posters 45 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • _ Offline
      _malek
      last edited by _malek

      I'm facing an issue where I can't track user interactions on the client’s website when it is opened through a captive portal. The site loads inside an iFrame, and even though I added all required URLs (including google-analytics.com) to the Allowed Hostnames, Google Analytics still doesn't record any events. I suspect the main problem is related to captive-portal restrictions. Has anyone found a solution to make GA tracking work in this scenario?

      tinfoilmattT GertjanG 2 Replies Last reply Reply Quote 0
      • tinfoilmattT Offline
        tinfoilmatt @_malek
        last edited by

        No.

        1 Reply Last reply Reply Quote 0
        • GertjanG Offline
          Gertjan @_malek
          last edited by

          @_malek said in Tracking User Interactions in Google Analytics for a Website Opened via an iFrame from a Captive Portal:

          I added all required URLs (including google-analytics.com) to the Allowed Hostnames, Google Analytics still doesn't record any events

          When you add "Allowed Hostname" to the portal, a DNS lookup is performed and an ( 1 !! ) IPv4 is rteurn so the pf firewall can filter to 'allow'.
          Remember : a firewall can ='can't filter hos names. Just "IP addresses" (see for yourself : [what is in an Ethernet packet header]( what is in an Ethernet packet header)).
          Gues what : "Google Analytics" isn't one IPv4 - it changes all the time, as that site (service) is used by billions any moment thousands of times per second (everybody want to do Google Analytics for some reason) so the load is DNS pre distributed / balanced over a lot of (major understatement) IPv4 addresses.

          https://docs.netgate.com/pfsense/en/latest/captiveportal/allowed-hostnames.html :

          41301874-d0e5-4a18-a5fe-8d55e22431f6-image.png

          If you manage to get them all, and you add all the possible IPv4s to the "Allowed IP Addresses" list, it might work.

          No "help me" PM's please. Use the forum, the community will thank you.
          Edit : and where are the logs ??

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.