Hello,
We are moving our analytics app from script tags to web pixels. In order to measure the time spent on a page we normally rely on document.focus and/or visibility but these are not available in the webPixel sandbox. Instead we would like to try to determine if a page is ‘active’ by looking at mouse events. These are available in the Advanced DOM Events. The doc says that this feature “Requires access to the Advanced DOM Events in web pixel app extensions scope. Request access in the Partner Dashboard.” but we can not find anywhere in the Partner Dashboard to make such a request. Web pixel app extensions only says that everything must be configured via the CLI. Can anyone help?
Hello Olivier,
In a Custom Web Pixel, which uses the Lax (iframe) sandbox, the Page Visibility API is available by default.
document.addEventListener('visibilitychange', (event) => {
console.log(document.visibilityState, event);
});
Unfortunately, this API doesn’t exist in the Strict (web worker) sandbox.
We might consider adding a visibility or page focus event in the future, but no ETA at this time. And even if we were to implement it, there are no way to notify sandboxes of the page closing, so it might still be unreliable to use it to compute time spent on a page.
As for the Advanced DOM Events, the feature is strictly restricted to apps providing heat maps and sessions recording features. More info will come soon on how to apply as the documented access request is temporarily unavailable.
Stay tuned!
Hi Emile,
Thank you for your very useful answer. Two more quick questions if you don’t mind.
-
Can a custom web pixel be created programmatically via the GrapQL API? Or does it have to be installed manually by the user?
-
If we add a heat map to our analytics reports, will we be able to get access to the Advanced DOM Events?
Custom Web Pixels can’t be created by apps right now, they’re limited to merchants tracking scripts, manually created through the admin.
As soon as the Advanced DOM events approval request process becomes available again, I’d suggest you apply and make a case for your app.
Having heat maps or session replays as a feature of the app will definitely help, but I don’t know enough about your specific app and use-case to say for sure if it is in-scope or not.
All my questions answered, and quickly!!! Thank you so much
The Advanced DOM Events documentation was updated today with the new process to request approval!
Thank you very much for the update Emile.
We will contact the team and hopefully they will grant access