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.


Prerequisite: You must already have an ACP account.

  1. Log into your ACP account
  2. Upload the model you wish to expose
  3. Use the radio button to select your model
  4. 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.
  5. 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).
  6. 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>
  7. 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.
  8. Find the javascript line that looks like:
    var so = new SWFObject("acpClient.", "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.", "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.
  9. Modify the flashWidth and flashHeight variables to match, e.g.:
    so.addVariable("flashWidth","800", )
    so.addVariable("flashHeight","500", )
  10. Delete the line defining the emailAddressFromCookie variable.
  11. You're done. View your web page in a browser.

See Also


You are not allowed to post comments.