2.2.3 Asynchronous loading of tag library

The eluminate.js tag library can be loaded asynchronously in web pages. Use the cmTagQueue object to ensure that all script sources are loaded and cm* function calls execute in the required order.

Example

<body>
<script type='text/javascript'>
var cmTagQueue = cmTagQueue || [];
cmTagQueue.push(['cmSetClientID', '99999999', false, "testdata.coremetrics.com", 
"mysite.com"]);
cmTagQueue.push(['cmCreatePageviewTag','AsyncTestPageID','CategoryID']);
</script>
<script type='text/javascript'>
(function() {
 var cm = document.createElement('script');
 cm.type = 'text/javascript';
 cm.async = true;
 cm.src = ('https:' == document.location.protocol ? 'https:' : 'http:') +
 '//libs.coremetrics.com/eluminate.js';
 (document.getElementsByTagName('head')[0] ||
 document.getElementsByTagName('body')[0]).appendChild(cm);
})
();
</script>
</body>
Note: Digital Data Exchange head.js script source cannot be loaded when eluminate.js library and cmSetClientID(...) script blocks are loaded asynchronously. Deployment of Digital Data Exchange page groups that are assigned to the Digital Data Exchange head container is not supported when loading the eluminate tag library asynchronously.