Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opt-out font family not taken into account #18890

Closed
Alice-Pa opened this issue Mar 7, 2022 · 4 comments
Closed

Opt-out font family not taken into account #18890

Alice-Pa opened this issue Mar 7, 2022 · 4 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@Alice-Pa
Copy link

Alice-Pa commented Mar 7, 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" ></iframe>

And the result I get:

image

Thanks,
Alice

@Alice-Pa Alice-Pa added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label Mar 7, 2022
@Findus23
Copy link
Member

Findus23 commented Mar 7, 2022

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.

@Findus23 Findus23 added answered For when a question was asked and we referred to forum or answered it. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. labels Mar 7, 2022
@Alice-Pa
Copy link
Author

Alice-Pa commented Mar 7, 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
Copy link
Member

Findus23 commented Mar 7, 2022

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
Copy link
Member

tsteur commented Mar 7, 2022

@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 #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.

@tsteur tsteur closed this as completed Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

3 participants