Skip to content

Added site detection for cloudflare and updated noData page to mention cloudflare #20566

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

Merged
merged 14 commits into from
Apr 12, 2023

Conversation

AltamashShaikh
Copy link
Contributor

Description:

Added site detection for cloudflare and updated noData page to mention cloudflare.
Fiixes: #PG-2726.

Review

@AltamashShaikh AltamashShaikh requested a review from sgiehl April 6, 2023 02:58
@AltamashShaikh AltamashShaikh marked this pull request as ready for review April 6, 2023 02:58
@AltamashShaikh AltamashShaikh added the Needs Review PRs that need a code review label Apr 6, 2023
@AltamashShaikh AltamashShaikh requested a review from snake14 April 6, 2023 03:04
Copy link
Contributor

@snake14 snake14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good. I only had a few minor comments. When I viewed the UI, things looked good. I noticed that it showed as detecting Cloudflare without me having to set the headers or anything, but it looks like it was showing as detecting GA as well. Is that part of being in development mode?

<p>&nbsp;&nbsp;&nbsp;&nbsp;Matomo URL: <code vue-directive="CoreHome.SelectOnFocus">{{ piwikUrl }}</code></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;{{ 'SitesManager_EmailInstructionsYourSiteId'|translate('<code vue-directive="CoreHome.SelectOnFocus">' ~ idSite ~ '</code>')|raw }}</p>
<p>8. {{ 'SitesManager_SiteWithoutDataCloudflareFollowStep8'|translate }}</p>
<p>9. {{ 'SitesManager_SiteWithoutDataCloudflareFollowStep9'|translate }}</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would using an ordered list (<ol>) instead of manual numbering format things a little more nicely here? I think it might make it so that you don't have to use &nbsp; to indent the extra lines under line 7 as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@snake14 spacing and all was breaking and that was the reason I didn't use that
Screenshot from 2023-04-06 15-26-41

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep in mind that we als have rtl languages where such spacing might not make sense. Also using an ordered list would make more sense for those languages, as the numbers might need to be placed on the other side or would be written with Romanian numbers. If you have problems with the layout its better to use css instead of trying to "fix" something using spaces

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to ol, please check again

@AltamashShaikh
Copy link
Contributor Author

ew minor comments. When I viewed the UI, things looked good. I noticed that it showed as detecting Cloudflare without me having to set the headers or anything, but it lo

@snake14 no its not by default, can you check the URL of your idsite, and if you CURL that url will you get those required headers?

<p>&nbsp;&nbsp;&nbsp;&nbsp;Matomo URL: <code vue-directive="CoreHome.SelectOnFocus">{{ piwikUrl }}</code></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;{{ 'SitesManager_EmailInstructionsYourSiteId'|translate('<code vue-directive="CoreHome.SelectOnFocus">' ~ idSite ~ '</code>')|raw }}</p>
<p>8. {{ 'SitesManager_SiteWithoutDataCloudflareFollowStep8'|translate }}</p>
<p>9. {{ 'SitesManager_SiteWithoutDataCloudflareFollowStep9'|translate }}</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep in mind that we als have rtl languages where such spacing might not make sense. Also using an ordered list would make more sense for those languages, as the numbers might need to be placed on the other side or would be written with Romanian numbers. If you have problems with the layout its better to use css instead of trying to "fix" something using spaces

@AltamashShaikh
Copy link
Contributor Author

@snake14 @sgiehl Updated to use ordered list instead of using <p> tag with numbers manually added

Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some more comments. In addition to that it might be helpful to also add a UI test around that. There are already a couple of tests around empty site detection. E.g. https://github.com/matomo-org/matomo/blob/71dcd54e1b70916cc61f5815352234308a4b8823/tests/UI/specs/EmptySite_GA4_spec.js

Copy link
Contributor

@snake14 snake14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look alright to me. The links have been updated to the actual FAQ URL.

"SiteWithoutDataCloudflare": "Cloudflare",
"SiteWithoutDataCloudflareDescription": "You can use the Matomo App in Cloudflare to track data, follow the instructions from this %1$sguide%2$s.",
"SiteWithoutDataCloudflareIntro": "If you use Cloudflare, you can start tracking data in Matomo seamlessly using the Matomo app available on Cloudflare.",
"SiteWithoutDataCloudflareFollowStepsIntro": "Follow this steps to set it up:",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"SiteWithoutDataCloudflareFollowStepsIntro": "Follow this steps to set it up:",
"SiteWithoutDataCloudflareFollowStepsIntro": "Follow these steps to set it up:",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Stan-vw This change looks good to you ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'steps' is a plural noun, therefore requires a plural demonstrative, 'this step' vs 'these steps'.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small tweaks:
"SiteWithoutDataCloudflare": "Cloudflare",
"SiteWithoutDataCloudflareDescription": "You can use the Matomo App in Cloudflare to track data, follow the instructions from %1$sthis guide%2$s.",
"SiteWithoutDataCloudflareIntro": "If you use Cloudflare, you can start tracking data in Matomo seamlessly using the Matomo App available in Cloudflare.",
"SiteWithoutDataCloudflareFollowStepsIntro": "Follow these steps to set it up:",

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops, you gotta teach me how to make the text so beautiful 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated as suggested

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Stan-vw If you find the lines to tweak on the 'Files Changed' tab up top, then click the blue + by the line number (or drag for multiple lines) it will add a comment against those lines, in the comment box that appears, on the toolbar, there is a page icon with a plus/minus symbol which will add a copy of the lines as a suggestion in the comment edit box, you can then edit this copy of the lines to what you think they should be.

This way they get formatted nicely, can be seen as a 'diff' on the files changes list, can be committed in a single click with attribution and it also creates a comment on the main conversation page here 🙂

@AltamashShaikh
Copy link
Contributor Author

@sgiehl Added UI test and deleted unwanted file

@AltamashShaikh AltamashShaikh requested a review from sgiehl April 12, 2023 02:36
Comment on lines 15 to 29
{% if ga4Used %}
{{ 'SitesManager_GA4DetectedEmail'|translate('Google Analytics 4', 'GA', 'https://matomo.org/faq/how-to/migrate-from-google-analytics-4-to-matomo/')|raw }}
{{ 'SitesManager_GADetectedEmail'|translate('Google Analytics 4', 'GA', 'https://matomo.org/faq/how-to/migrate-from-google-analytics-4-to-matomo/')|raw }}
{{ 'CoreAdminHome_JSTracking_ConsentManagerEmailNote'|translate }}
{% endif %}

{% if gtmUsed %}
{{ 'SitesManager_GTMDetectedEmail'|translate('Google Tag Manager', 'GTM', 'https://matomo.org/faq/tag-manager/migrating-from-google-tag-manager/')|raw }}
{{ 'SitesManager_GTMDetectedEmail'|translate('https://matomo.org/faq/tag-manager/migrating-from-google-tag-manager/')|raw }}
{{ 'CoreAdminHome_JSTracking_ConsentManagerEmailNote'|translate }}
{% endif %}


{% if cloudflare %}
{{ 'SitesManager_CloudflareDetectedEmail'|translate('https://matomo.org/faq/new-to-piwik/how-do-i-install-the-matomo-tracking-code-on-my-cloudflare-setup/')|raw }}
{{ 'CoreAdminHome_JSTracking_ConsentManagerEmailNote'|translate }}
{% endif %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might actually look a bit weird in the email, as if multiple stuff is detected each will be displayed with the sentence Or you could directly embed the tracking code in your website instead: in the end.
But I guess improving this generated email (content) might be part of another issue maybe?
ping @Stan-vw

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Stan-vw This is what Stefan meant
Screenshot from 2023-04-12 13-58-59

@sgiehl Updated the logic
Screenshot from 2023-04-12 14-09-34

Copy link
Contributor

@Stan-vw Stan-vw Apr 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love to improve this email but since we want to ship these changes as quickly as possible I'm ok with the last email format.
@AltamashShaikh, give me a call when you're up, would be good for me to understand how we can iterate this email 👍
cc: @Javi-Ormaechea

@sgiehl sgiehl added this to the 5.0.0 milestone Apr 12, 2023
Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left another minor comment, that might not be part of this issue.
Otherwise this looks good to merge for me.

@sgiehl sgiehl merged commit 8917e26 into 5.x-dev Apr 12, 2023
@sgiehl sgiehl deleted the PG-2726-cloudflare-no-data branch April 12, 2023 08:45
AltamashShaikh added a commit that referenced this pull request Apr 12, 2023
…n cloudflare (#20566)

* Added site detection for cloudflare and updated noData page to mention cloudflare, #PG-2726

* UI fixes

* PR ceomments resolution

* Changed to ol from p

* Spacing for url and idsite fixed

* Updated with FAQ url

* Updated logic for updatedTab

* Created UI test for cloudflare

* UI test case updated

* Updated UI screenshots

* textual changes

* Updated UI screenshot

* Updated UI screenshot

* Tracking email code fixed
sgiehl pushed a commit that referenced this pull request Apr 12, 2023
…n cloudflare (#20573)

* Added site detection for cloudflare and updated noData page to mention cloudflare (#20566)

* Added site detection for cloudflare and updated noData page to mention cloudflare, #PG-2726

* UI fixes

* PR ceomments resolution

* Changed to ol from p

* Spacing for url and idsite fixed

* Updated with FAQ url

* Updated logic for updatedTab

* Created UI test for cloudflare

* UI test case updated

* Updated UI screenshots

* textual changes

* Updated UI screenshot

* Updated UI screenshot

* Tracking email code fixed

* Cherrypicked Cloudflare changes from 5.x-dev

* Removed uneanted lines added due to merge
@sgiehl sgiehl added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Development

Successfully merging this pull request may close these issues.

6 participants