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

[DPMMA-1866] Map with e-mail statistics #12570

Merged
merged 83 commits into from
May 17, 2024

Conversation

annamunk
Copy link
Member

@annamunk annamunk commented Jul 20, 2023

Q A
Bug fix? (use the a.b branch) [❌]
New feature/enhancement? (use the a.x branch) [✅]
Deprecations? [❌]
BC breaks? (use the c.x branch) [❌]
Automated tests included? [✅]
Related user documentation PR URL mautic/mautic-documentation#...
Related developer documentation PR URL mautic/developer-documentation#...
Issue(s) addressed Fixes #...

Description:

This PR introduces a map preview with email read and click statistics. Statistics are consistent with existing charts - a read or click on an e-mail is counted as 1, regardless of the number of reopenings or the number of clicked links. The map legend shows the total number of reads/clicks and how many of them were made by contacts with a non-empty country, because the statistics for leads without a location cannot be marked on the map.

Email preview (s/emails/view/{email_id})

map_email

Campaign preview (/s/campaigns/view/{campaign_id})
campaign
Email campaign
campaign_email

As part of this PR, zoom controls and map tooltip have been enlarged, so the Map widget on the dashboard and the map in the contact view (Places tab) will also change slightly in appearance, but their functionality should remain the same:
dashboard

Steps to test this PR:

  1. Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs here)
  2. Create at least one email. Send it to several contacts (preferably with a non-empty country field), then open and click on the link of at least one of messages.
  3. Email statistics should be correctly displayed in the e-mail view (s/emails/view/{email_id}) "Map" tab.
  4. Create and run a test campaign with at least one "email.send" event.
  5. Simulate reads and clicks on messages sent from the campaign.
  6. Statistics from all emails sent from the campaign should be displayed in campaign preview (/s/campaigns/view/{campaign_id}) in "Map" tab.

@annamunk annamunk requested a review from mabumusa1 as a code owner July 20, 2023 16:50
@annamunk annamunk marked this pull request as draft July 21, 2023 08:39
@codecov
Copy link

codecov bot commented Jul 21, 2023

Codecov Report

Attention: Patch coverage is 98.85714% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 61.88%. Comparing base (4883fa0) to head (1646bc6).
Report is 1 commits behind head on 5.x.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                5.x   #12570      +/-   ##
============================================
+ Coverage     61.62%   61.88%   +0.25%     
- Complexity    34145    34193      +48     
============================================
  Files          2245     2248       +3     
  Lines        102077   102258     +181     
============================================
+ Hits          62909    63286     +377     
+ Misses        39168    38972     -196     
Files Coverage Δ
app/bundles/CampaignBundle/Entity/Campaign.php 81.56% <100.00%> (+0.98%) ⬆️
...p/bundles/CampaignBundle/Entity/LeadRepository.php 73.80% <100.00%> (+1.56%) ⬆️
app/bundles/CampaignBundle/Model/CampaignModel.php 76.16% <100.00%> (+1.32%) ⬆️
app/bundles/CoreBundle/Helper/MapHelper.php 100.00% <100.00%> (ø)
app/bundles/EmailBundle/Entity/StatRepository.php 42.96% <100.00%> (+7.66%) ⬆️
app/bundles/EmailBundle/Model/EmailModel.php 50.81% <100.00%> (+0.40%) ⬆️
...gnBundle/Controller/CampaignMapStatsController.php 95.65% <95.65%> (ø)
...EmailBundle/Controller/EmailMapStatsController.php 95.65% <95.65%> (ø)

... and 6 files with indirect coverage changes

@annamunk annamunk changed the title [DPMMA-1866] Email map [DPMMA-1866] Map with e-mail statistics Jul 25, 2023
@annamunk annamunk marked this pull request as ready for review July 25, 2023 10:37
Copy link
Member

@patrykgruszka patrykgruszka left a comment

Choose a reason for hiding this comment

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

I have added a few comments to the code which are worth taking into account.

A few general comments and thoughts:

  • In the email view, the map works well.
  • In Campaign I was expecting a map with contacts that started the campaign, but there is a map with email interactions, should it be this way?
  • Maybe a UI/UX person should look at these changes if there is something to improve?
  • When I added a map widget to the dashboard, the lead number tooltips stopped working.
  • The lead number tooltips aren't displayed in the dashboard map widget.

@annamunk
Copy link
Member Author

annamunk commented May 8, 2024

@escopecz thank you for your review. I fixed the errors, removed the abstract controller and the model interface. I moved the methods to controllers. I think it's a good idea to refactor it as a service in the future if the functionality is developed further. Please check if these changes are ok.

@annamunk annamunk requested a review from escopecz May 8, 2024 10:33
@RCheesley RCheesley removed the pending-feedback PR's and issues that are awaiting feedback from the author label May 9, 2024
@annamunk annamunk requested a review from escopecz May 14, 2024 19:12
Copy link
Sponsor Member

@escopecz escopecz left a comment

Choose a reason for hiding this comment

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

I went through the code again and found one last small tiny thing I'd improve.

app/bundles/EmailBundle/Translations/en_US/messages.ini Outdated Show resolved Hide resolved
@annamunk
Copy link
Member Author

@escopecz thank you! I commited the suggested change and slightly improved the database query.

@annamunk annamunk requested a review from escopecz May 17, 2024 12:34
Copy link
Sponsor Member

@escopecz escopecz left a comment

Choose a reason for hiding this comment

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

Anna, thank you for your hard work! This is quite a useful feature so marketers understand their audience better and will see what works where in the world.

Screenshot 2024-05-17 at 17 16 40

@escopecz escopecz removed the pending-test-confirmation PR's that require one test before they can be merged label May 17, 2024
@escopecz escopecz merged commit a66c8d0 into mautic:5.x May 17, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
campaigns Anything related to campaigns and campaign builder code-review-passed PRs which have passed code review dashboard Anything related to the Dashboard email Anything related to email enhancement Any improvement to an existing feature or functionality
Projects
Status: 🥳 Done
Development

Successfully merging this pull request may close these issues.

None yet

7 participants