Add embedded event.
This commit is contained in:
parent
8a56d50c87
commit
bf49f7d77f
@ -6,6 +6,7 @@ import { Viewer } from '../engine/viewer/viewer.js';
|
||||
import { HashHandler } from './hashhandler.js';
|
||||
import { ThreeModelLoaderUI } from './threemodelloaderui.js';
|
||||
import { Direction } from '../engine/geometry/geometry.js';
|
||||
import { HandleEvent } from './eventhandler.js';
|
||||
|
||||
export class Embed
|
||||
{
|
||||
@ -91,6 +92,10 @@ export class Embed
|
||||
window.addEventListener ('resize', () => {
|
||||
this.Resize ();
|
||||
});
|
||||
|
||||
if (window.parent && window.parent.location && window.parent.location !== window.location) {
|
||||
HandleEvent ('embedded', window.parent.location.href);
|
||||
}
|
||||
}
|
||||
|
||||
Resize ()
|
||||
|
||||
@ -27,6 +27,15 @@
|
||||
<!-- website end -->
|
||||
|
||||
<!-- analytics start -->
|
||||
<script type="text/javascript">
|
||||
OV.SetWebsiteEventHandler ((eventName, eventLabel, eventParams) => {
|
||||
console.log ({
|
||||
eventName : eventName,
|
||||
eventLabel : eventLabel,
|
||||
eventParams : eventParams
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<!-- analytics end -->
|
||||
|
||||
<!-- embed init start -->
|
||||
|
||||
Loading…
Reference in New Issue
Block a user