Heap sideloading (legacy)
In sideloading mode, the Contentsquare Tag injects the Heap SDK (heap.js) into the page and the Product Analytics Tag commands act as thin wrappers around the equivalent heap.* calls. Data is collected and sent by the Heap SDK, not by the Contentsquare Tag.
In native collection, no Heap SDK is loaded: the Contentsquare Tag collects Product Analytics data itself and sends it with its own requests.
Identifying the mode
Section titled Identifying the modeA sideloaded project sends cw=2 on its pageview requests, and window.heap is defined on the page. A natively collecting project sends cw=1 and does not define window.heap.
Content Security Policy
Section titled Content Security PolicyBecause the Tag loads an additional script and that script sends its own requests, sideloading requires CSP directives beyond those needed for native collection. Select the matching mode in the builder on Content Security Policy to get the correct directives.
Command behavior
Section titled Command behaviorIn sideloading mode the following commands wrap their Heap SDK equivalents. The signatures are the same as those documented in the Tag API reference, with the differences listed here.
| Command | Wraps | Heap reference | Available since |
|---|---|---|---|
trackEvent | heap.track | track ↗ | 15.247.0 |
identify | heap.identify | identify ↗ | 15.1.0 |
resetIdentity | heap.resetIdentity | resetIdentity ↗ | 15.1.0 |
getIdentity | heap.getIdentity | getIdentity ↗ | 15.1.0 |
addUserProperties | heap.addUserProperties | addUserProperties ↗ | 15.31.0 |
customProperties:visit:add | heap.addEventProperties | addEventProperties ↗ | 15.152.0 |
customProperties:visit:remove | heap.removeEventProperty | removeEventProperty ↗ | 15.152.0 |
customProperties:visit:clear | heap.clearEventProperties | clearEventProperties ↗ | 15.152.0 |
All of these commands support iframes (iframe). None of them support webviews in this mode.
Commands not available
Section titled Commands not availablePageview property commands (customProperties:page:add, customProperties:page:remove, and customProperties:page:clear) have no Heap SDK equivalent and are not available in sideloading mode.
identify does not accept hashing options
Section titled identify does not accept hashing optionsThe { hash: true } option documented for identify is not supported: the command passes the identity string straight to heap.identify(). Hash the identifier yourself before calling the command if you need it hashed.
window._uxa.push(["identify", identityString]);getIdentity returns the Heap identity
Section titled getIdentity returns the Heap identitygetIdentity forwards to heap.getIdentity() and returns whatever the Heap SDK holds. In native collection, the command returns a hash of the identity string rather than the string itself.
Call identify after the Tag has initialized
Section titled Call identify after the Tag has initializedAvoid arbitrary setTimeout workarounds. Use afterPageView instead: the callback runs after the Tag's initial bootstrap, so window.heap is defined.
window._uxa.push([ "afterPageView", function (context) { // Only run on natural pageviews, not artificial or renewal ones if (context.pageViewType !== "n") return;
window._uxa.push(["identify", identityString]); },]);Migrating to native collection
Section titled Migrating to native collectionNative collection removes the second SDK from the page, supports webviews, adds pageview properties, and simplifies your CSP. Contact your Customer Success Manager to plan the migration.

