F5 Sites
  • F5.com
  • LearnF5
  • NGINX
  • MyF5
  • Partner Central
Contact
  • Under Attack?
  • F5 Support
  • DevCentral Support
  • F5 Sales
  • NGINX Sales
  • F5 Professional Services
Skip to contentBrand Logo
Forums
CrowdSRC
Articles
Groups
EventsSuggestionsHow Do I...?
RegisterSign In
  1. DevCentral
  2. CrowdSRC
  3. CodeShare

APM - Track clicks on webtop resources

Problem this snippet solves: This configuration sample provide to the administrator a way to log all APM webtop resources clicked by a logged-in user. Those logs can be exported to external systems ...
Updated Jun 06, 2023
Version 2.0
application delivery
BIG-IP Access Policy Manager (APM)
iRules
security
Yann_Desmarest's avatar
Yann_Desmarest
Icon for Cirrus rankCirrus
Joined September 11, 2012
View Profile
brad_11480's avatar
brad_11480
Icon for Nimbostratus rankNimbostratus
Sep 19, 2018

Well close.. Still didn't seem to be hitting 100%. But the following modification seems to be working much better..

window.onclick = function (e) {
    if (e.target.parentNode.className == "favorite" || e.target.parentNode.className == "image" || e.target.parentNode.className == "caption") {
        var xhttp = new XMLHttpRequest();
        console.log(e.target.parentNode.id);
        var parentNodeId = "";

        //populate parent's parent
        if (e.target.parentNode.parentNode.id) {
            parentNodeId = e.target.parentNode.parentNode.id;
        }
        //overwrite parent's parent if parent not null
        if (e.target.parentNode.id) {
            parentNodeId = e.target.parentNode.id;
        }

        //open link
        if (parentNodeId) {
            var uri = "/analytics?t=" + Math.random() + "&r=" + encodeURIComponent(window.btoa(parentNodeId)) + "&d=" + Date.now();
            xhttp.open("GET", uri, true);
            xhttp.send();
        }
        //log failed result
        else {
            console.log("Parent ID is NULL");
        }
    }
};


ABOUT DEVCENTRAL

DevCentral NewsTechnical ForumTechnical ArticlesTechnical CrowdSRCCommunity GuidelinesDevCentral EULAGet a Developer Lab LicenseBecome a DevCentral MVP

RESOURCES

Product DocumentationWhite PapersGlossaryCustomer StoriesWebinarsFree Online CoursesF5 CertificationLearnF5 Training

SUPPORT

Manage SubscriptionsProfessional ServicesProfessional ServicesCreate a Service RequestSoftware DownloadsSupport Portal

PARTNERS

Find a Reseller PartnerTechnology AlliancesBecome an F5 PartnerLogin to Partner Central

F5 logo©2024 F5, Inc. All rights reserved.
TrademarksPoliciesPrivacyCalifornia PrivacyDo Not Sell My Personal Information