Embedding Oracle Analytics — What are the Options?

Mike Durran
Oct 5 · 4 min read

Introduction

Embedding analytics, where it is relevant, adds value ‘in context’. For example, embedding analytics on typical business expenditure within an application for reviewing and approving expenses can save time and resource. Embedding can also be used to build custom web or mobile analytic applications or share insight on a corporate portal or website.

Custom App Built with Embedded Oracle Analytics, HTML, CSS and JavaScript

Options for Embedding Oracle Analytics

Oracle Analytics provides a number of options for embedding insight. These include the use of iFrames or a JavaScript embedding framework that offers greater flexibility and programmatic control over the embedded content and can be of benefit to a custom built application. Since embedding usually involves including content from an ‘external’ source, it is required to enter ‘Safe Domains’ within the relevant applications due to Cross Origin Resource Sharing (CORS) standards. Oracle Analytics also offers the ability to use ‘vanity URLs’ that can also be useful when dealing with cross-domain embedding scenarios.

Embedding with iFrames

An iFrame is a way of embedding content from an external source in an application or web page. This is the easiest way to embed analytics, referencing the URL of the analytics project in the iFrame ‘src’ parameter.

https://<OracleAnalyticsInstance>-ia.analytics.ocp.oraclecloud.com/ui/dv/?pageid=visualAnalyzer&reportmode=presentation&reportpath=<PathToProject>

Embedding with the Oracle Analytics JavaScript Framework

Oracle Analytics Data Visualization (DV) is built using a JavaScript toolkit called Oracle JET. As a result, Oracle Analytics offers a framework for embedding analytics that can be suited to custom applications or scenarios where more programmatic control is required.

Oracle Analytics Developer Menu with Embedding References
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Embedded Oracle Analytics Project Example</title><script src="https://<instance>.analytics.ocp.oraclecloud.com/public/dv/v1/embedding/<embedding mode>/embedding.js" type="application/javascript">
</script>
</head>
<body>
<h1>Embedded Oracle Analytics Project</h1>
<div style="border:1px solid black;position: absolute; width: calc(100% - 40px); height: calc(100% - 120px)" >
<!-- The following tag is the tag that will embed the specified project. --><oracle-dv
project-path="<project path>"
active-page="canvas"
active-tab-id="1">
</oracle-dv>
</div><!-- Apply Knockout bindings after DV project is fully loaded. This should be executed in a body onload handler or in a <script> tag after the <oracle-dv> tag. --><script>
requirejs(['knockout', 'ojs/ojcore', 'ojs/ojknockout', 'ojs/ojcomposite', 'jet-composites/oracle-dv/loader'], function(ko) {
ko.applyBindings();
});
</script>
</body>
</html>

Embedding into Oracle Visual Builder

Oracle Visual Builder is a low code application development tool that makes use of Oracle JET UI components to provide a way to build both web and mobile applications. Visual Builder is an extendable platform and Oracle Analytics provides a web component in the Visual Builder exchange that makes it easy to embed content from Oracle Analytics into a Visual Builder application (search for ‘analytics’ or ‘oj-oa-project’ in the VB exchange).

Oracle Analytics Embedding Web Component in Visual Builder Exchange
Using the Oracle Analytics Embedding Web Component in a Visual Builder Application

Summary

This blog has provided a quick tour of the various options for embedding Oracle Analytics. The use of iFrames that reference the analytics content URL is a quick way to embed analytics insight, in context, within an application or webpage. For a more programmatic approach to embedding, the JavaScript embedding framework offers greater flexibility and control. For a low-code / no-code approach to building analytic applications, the analytics web component in the Visual Builder exchange offers an easy method to embed.

Oracle Developers

A community for developers by developers.

Oracle Developers

Aggregation of articles from Oracle engineers, Groundbreaker Ambassadors, Oracle ACEs, and Java Champions on all things Oracle technology. The views expressed are those of the authors and not necessarily of Oracle.

Mike Durran

Written by

Analytics Product Manager at Oracle. [All content and opinions are my own]

Oracle Developers

Aggregation of articles from Oracle engineers, Groundbreaker Ambassadors, Oracle ACEs, and Java Champions on all things Oracle technology. The views expressed are those of the authors and not necessarily of Oracle.