DSUMO for Sites - Integration

Integrating DSUMO with Your Website

Integrating DSUMO with your website is easy. Add the following code to any pages on which you want your visitors to process microcompute operations (MOs):

  1. <script type="text/javascript" src="http://kisolabs.net.kisocdnb.net/dsumo/js/dsumo-engine.js"></script>
  2. <script type="text/javascript">
  3. DSUMO.dsumoEngine.register('[Your GUID]', '[Unique Visitor Id]');
  4. </script>

Line 1: Loads the DSUMO Engine. This is the code that interfaces with the DSUMO servers to get microcompute operations (MOs) for your users to process. It also provides the DSUMO Framework which contains both the context in which MOs run, the throttling mechanism which prevents the MOs from using too much of the client's system resources, and DSUMO helper functions that MOs can utilize.

The DSUMO engine code is hosted by KisoLabs CDN service to ensure high availability and rapid fetch times that will not slow your users' experience of your site.

Line 3: Starts the DSUMO Engine. All DSUMO functions are implemented under the veritable namespace DSUMO, and the dsumoEngine object is instantiated in the script that is loaded on line 1.

The register function takes two arguments, the second of which is optional:

register('[Your GUID]', '[Unique Visitor Id]');

  • [Your GUID] is the GUID for your website, and is listed at the top of this page. This is necessary to ensure that your account gets credit for all MOs processed by your site's users.
  • [Unique Visitor Id] (optional) is a unique identifier created within your codebase that corresponds to the session of a user on your site. This helps DSUMO to optimize its delivery of MOs to your users based upon their average page view times. (Because of cross-browser restrictions on Ajax calls, it is not always possible for DSUMO to track users between page loads). This argument must satisfy the following regular expression in order to be considered valid: ^[a-zA-Z0-9,-]{1,64}$

For optimal performance of your site, follow these tips:

  • If you are using jQuery or Prototype in your pages' code, DSUMO will make use of it in order to process Ajax calls. As such, put the above code snippet where it will load after jQuery or Prototype loads.
  • Optimally, the above code snippet should be placed at the bottom of your page(s), just before the </body> tag. This will ensure that your site's content loads completely before DSUMO starts.
  • If your content is loaded dynamically, for example via Ajax calls, call the function DSUMO.dsumoEngine.register dynamically after your content loads. However, do not call the function repeatedly when your dynamic content is refreshed. The register function should only be called once per page load.
  • If your site's content is contained within an iframe, you should place the above code snippet outside of the iframe.
  • You will get the most benefit from DSUMO when microcompute operations (MOs) are allowed to run to completion on your users' browsers. This may take anywhere from under one second to as much as one minute. It is therefore optimal to put the call to DSUMO.dsumoEngine.register wherever it will be reloaded the least.
© KisoLabs 2017
w01
KisoLabs