Embedding an ACP model in a Web Page
People normally view Analytica Cloud Platform (ACP) models from [1]. However, you may want to embed your model inside your own web page, on your own web site. When you do this, your users see the ACP model as a rectangular region within your HTML content, but are unaware that the model itself is actually being run on the ACP server. Your own HTML content can surround the rectangular ACP area.
This page provides instructions for how to configure your own web page to display an ACP model.
You should be aware that any time a new user arrives at your web page, the model will appear and an ACP session credit will be consumed.
Steps
Prerequisite: You must already have an ACP account.
- Log into your ACP account
- Upload the model you wish to expose
- Use the radio button to select your model
- Find the invite in your email and click on the URL to launch the model in a browser.
- Note: We use an invite, rather than a direct view of the model, in order to copy the credentials of a guest viewing the model.
- Click on the address bar (to ensure focus is on the browser window and not the embedded flash player). Then Press Ctrl+U (View source).
- In the <head> section, you will find one or more java script include tags, which look something like this:
<script type="text/javascript" src="swfobject.js" > </script>
- Copy these to your own HTML <head> section, and modify the file name to include a full path prefix like this:
<script type="text/javascript" src="https://www.analyticacloud.com/acp/client/swfobject.js" > </script>
- In the <body> section, you'll find a
<div>
and a<script>
block. Copy these to your own HTML, where you want the ACP rectangle to appear. The<div>
has an id of "flashcontent". You can modify the CSS properties of the<div>
to control where it appears on your web page. - Find the javascript line that looks like:
var so = new SWFObject("acpClient.2.6.0.99.swf", "acpClient", "1600", "1000", ....
- Add the full path prefix to the swf file name, and modify the width and height to be the desired width and height for the ACP rectangle on your web page, e.g.:
var so = new SWFObject("="https://www.analyticacloud.com/acp/client/acpClient.2.6.0.99.swf", "acpClient", "800", "600", ....
- Be sure to modify your actual javascript source, and not just copy what is here, since you want to get the ACP revision that is current when you are making these changes.
- Modify the
flashWidth
andflashHeight
variables to match, e.g.:so.addVariable("flashWidth","800", )
so.addVariable("flashHeight","500", )
- Delete the line defining the
emailAddressFromCookie
variable. - You're done. View your web page in a browser.
See Also
Comments
Enable comment auto-refresher