Closed tpendragon closed 4 months ago
Are there any plausible docs you used to work this out? It would be nice to have the links to them in the description of the PR.
@hackartisan Good idea! Added some links.
Drafted so I can add some tests of this plausible functionality.
The download pane in Universal Viewer:
window.open
to open a link. (https://github.com/UniversalViewer/universalviewer/blob/main/src/content-handlers/iiif/extensions/uv-openseadragon-extension/DownloadDialogue.tsx#L431)Thus we can fire a custom event by, if Universal Viewer is loaded, overriding
window.open
in the viewer. This also adds an "?embed_host" property that can be added to the iframe, and sends the environment it's sending as. This is done via the documentation at https://plausible.io/docs/custom-props/for-pageviews#2-add-your-custom-properties-to-your-plausible-snippet.Finally, this uses
manual
for Plausible, which means it doesn't automatically track page views - I don't think we care how many people go to/viewer
, just how many people interact with that viewer.The documentation for sending a custom event with properties in Plausible is here: https://plausible.io/docs/custom-props/for-custom-events#2-using-the-manual-method
Closes #6376 Closes #6377
This will miss any downloads done from within Figgy. We could do that, but I'm not sure it's necessary - that's not a public interface our patrons will be accessing.