Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

OBIEE 12c - Installing/Using Google Analytics to Track Usage in OBIEE12c

Received Response
41
Views
4
Comments
Rank 6 - Analytics Lead

I was recently asked to see if I could get Google Analytics working in OBIEE 12c to see if there was a way to track usage.

I know that OBIEE 12c has its own internal usage tracking via the tables S_NQ_ACCT, S_NQ_DB_ACCT and S_NQ_INITBLOCK - But this tracks usage only when someone executes a query/runs a report.

From my initial research it looks like there has to be a chunk of javascript code with a key from Google that I put onto the webpage that I want to enable tracking for.

But for OBIEE 12c, I am not sure where or if it is possible to put this Google javascript code?

I was able to find this article:

http://www.redaelli.org/matteo-blog/2014/09/29/adding-google-analytics-to-oracle-obiee/comment-page-1/

Which mentions being able to modify a [common.js] file which is not a file I can find any info on.

I was wondering has anyone been able to put Google Analytics to track OBIEE 12c usage?

Thanks in advance

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • Rank 2 - Community Beginner

    If you want to modify the common.js you have to unpack and go into the analytics.ear, same then for the war, then modify the common.js, repack everything, undeploy the analytics deployment in Enterprise manager and redeploy your new "custom" .ear:

    pastedImage_0.png

    Straight and unfiltered, BUT - do it at your own risk. 100000% at your own risk!

  • Rank 6 - Analytics Lead

    Thanks very much for this Christian - I actually ended up going a different route (a quick and dirty way) to test this in our sandbox

    I ended up modifying the common.js file in the following two locations

    1) /itadm/u01/obiee/middleware/obiee12c_domain_home/user_projects/domains/bi/servers/bi_server1/tmp/_WL_user/analytics/za01ic/war/res/b_mozilla

    2) /itadm/u01/obiee/middleware/obiee12c_domain_home/user_projects/domains/bi/servers/bi_server1/tmp/_WL_user/analytics/eiguw6/war/res/b_mozilla

    Im not sure if I just need to modify one of the common.js files, or are both necessary but since I am testing this in our sandbox I just modified both files.

    I used the following website for guidance

    https://developers.google.com/analytics/devguides/collection/analyticsjs/

    and I used the following javascript code as per Google

    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-XXXXX-Y', 'auto');
    ga('send', 'pageview');

    Also as per the mentioned blog, I removed the <script></script> text and just used the above code with our google tracker id.

    After modifying the two common.js files, I restarted the server.

    When I checked our google analytics, there were no stats coming through. So I continued to check /analytics homepage to look for errors via Google Chrome developer tools and found the following error

    pastedImage_1.png

    pastedImage_4.png

    So I hit a content security policy error.

    So I did more digging and came across this article in oracle support (Doc ID 2148973.1)

    https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=229608566907135&id=2148973.1&_afrWindowMode=0&_adf.ctrl-state=yj8wroua3_4

    Which basically states to do the following

    Add the below tags in the instanceconfig.xml:

    <Security>
    <ContentSecurityPolicy>
    <Enable>false</Enable>
    </ContentSecurityPolicy>
    </Security>

    Finally after all this I can see Google Analytics with stats.

    But again, this is just me testing quick and dirty in our sandbox environment.

    I will likely be modifying the analytics.war file as per Christians very helpful suggestion, but just wanted to post what I found so far. A lot of people mention google maps/google charts and google analytics but fail to mention security settings like the Content Security Policy.

  • chillychin wrote:Add the below tags in the instanceconfig.xml:<Security>
    <ContentSecurityPolicy>
    <Enable>false</Enable>
    </ContentSecurityPolicy>
    </Security>

    NO!

    Please no!!!!!

    How does it sounds like a good idea to just turn a security feature off instead of configuring it?

    Oracle official documentation cover how to configure it properly, MOS documents cover how to configure it properly, blog posts cover how to configure it properly. It takes as much time as turning it off!

    I guess you have a firewall somewhere on your laptop or at home: do you turn it off when needing to open a port for a given service? I don't think so, so why would you do that in OBIEE?

    https://gianniceresa.com/2016/10/google-map-in-an-obiee-12c-analysis/

    https://docs.oracle.com/middleware/1221/biee/BIESG/answersconfigset.htm#BIESG9326

    chillychin wrote:A lot of people mention google maps/google charts and google analytics but fail to mention security settings like the Content Security Policy.

    I disagree ... time to read better blog posts

    PS: I sent a message to the author of that MOS document to "nicely" tell him how his solution is wrong !

  • Rank 6 - Analytics Lead

    Thanks for posting that blog post Gianni

    I am still in the sandbox testing enviroment, so will need to take a look over to see how to make it work properly as you suggested.

    As I mentioned I was just doing a quick and dirty test in our sandbox enviroment to verify it works. But will need to do a more proper/formal way as you suggested

    Actually this is a bit off topic, but I was wondering have you ever seen this error:

    [ Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource]

    As I was playing around with Google Analytics to get it working, I was trying to get Google Charts working as a next step, then Google Maps. But when trying to work on Google Charts I hit that above error (no access control allow origin)

Welcome!

It looks like you're new here. Sign in or register to get started.