@Alice-Pa opened this Issue on March 7th 2022

Hello,

I have tried to specify a font family in the opt-out iFrame but it is not taken into account.
In the code below, I tried to use "apple-system", which is one of the fonts used into Matomo, with several variations (dash, simple quote, double quote, etc.) but no luck.

Here is the code I generated:
`<iframe
style="border: 0; height: 200px; width: 600px;"
src="https://matomo.cnrs.fr/index.php?module=CoreAdminHome&action=optOut&language=fr&backgroundColor=f2f6ff&fontColor=2e2f32&fontSize=14px&fontFamily=apple-system"


`

And the result I get:

image

Thanks,
Alice

@Findus23 commented on March 7th 2022 Member

Checking the source of
https://demo.matomo.cloud/index.php?module=CoreAdminHome&action=optOut&language=fr&backgroundColor=f2f6ff&fontColor=2e2f32&fontSize=14px&fontFamily=apple-system
it contains font-family: apple-system; as requested.
But font-family: apple-system; doesn't really exist, do you by chance mean -apple-system? And even then you might also want to specify another font for non-apple devices.

@Alice-Pa commented on March 7th 2022

Hi,
Indeed my initial expectation was to use another font which is "Libre Franklin Regular" (the one used on the tracked site) but it did not work either therefore I tested with a font used by Matomo to confirm the analysis.
Alice

@Findus23 commented on March 7th 2022 Member

the one used on the tracked site

Keep in mind that the opt out is in an iFrame and therefore doesn't have any access to webfonts or any other content of the parent page. So unless the uses has the font installed or you use https://plugins.matomo.org/CustomOptOut to add more CSS (with the webfont) to the Matomo page, then it is expected that it won't work.

But at this point you might want to instead use https://developer.matomo.org/guides/tracking-javascript-guide#optional-creating-a-custom-opt-out-form to make an opt out form on your website itself instead of an iFrame, which has the advantage of being styled just like any other content on your site.

@tsteur commented on March 7th 2022 Member

@Alice-Pa I'll close this issue for now as everything is working as expected on our side. Feel free to continue commenting though.

We're starting the work on issue https://github.com/matomo-org/matomo/issues/17452 very soon. This will be a different way of providing the opt out where it will then be possible (or even the default) that your site's font will be used.

This Issue was closed on March 7th 2022
Powered by GitHub Issue Mirror