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

MWPW-156866 [MILO][MEP] Create martech metadata table if placeholders are used in non EN page #2780

Merged
merged 15 commits into from
Sep 3, 2024

Conversation

AdobeLinhart
Copy link
Contributor

@AdobeLinhart AdobeLinhart commented Aug 22, 2024

When we use MEP placeholders on a non EN page, the analytics don't stay in English. To combat this, we will add to the martech-metadata.

In libs/features/personalization/personalization.js parsePlaceholders function, we decide the column of values we will use.

We should check the value of config.locale.ietf. If it equals en-US we don't need to generate a table.

If it doesn't, we need to see if there is a good column for us to use for the original English text. Column names we want to use in order of preference: en-us, us, en.

I think you can make an array with those values, then reuse the code we use to build the placeholder object to build a translation object. Move it to a reusable function maybe.

Then add to config.mep and reference your new data in martech/attributes.js

Resolves: MWPW-156866

QA instructions
In the before and after links, inspect the buttons in the marquee. The analytics should now show en-us version of the placeholder instead of the fr.

Test URLs:

@AdobeLinhart AdobeLinhart requested a review from a team as a code owner August 22, 2024 22:03
Copy link
Contributor

aem-code-sync bot commented Aug 22, 2024

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

Copy link
Contributor

aem-code-sync bot commented Aug 22, 2024

Page Scores Audits Google
M /?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
D /?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@AdobeLinhart AdobeLinhart requested a review from a team August 22, 2024 22:03
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.90%. Comparing base (0ae86a3) to head (a500f50).
Report is 23 commits behind head on stage.

Additional details and impacted files
@@            Coverage Diff             @@
##            stage    #2780      +/-   ##
==========================================
+ Coverage   95.89%   95.90%   +0.01%     
==========================================
  Files         173      173              
  Lines       45853    45870      +17     
==========================================
+ Hits        43969    43992      +23     
+ Misses       1884     1878       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

This pull request is not passing all required checks. Please see this discussion for information on how to get all checks passing. Inconsistent checks can be manually retried. If a test absolutely can not pass for a good reason, please add a comment with an explanation to the PR.

Copy link
Contributor

@mokimo mokimo left a comment

Choose a reason for hiding this comment

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

Is this really necessary? Can't we re-use the existing placeholder entries?
They've recently been exposed https://github.com/adobecom/milo/pull/2737/files

@vgoodric
Copy link
Contributor

Is this really necessary? Can't we re-use the existing placeholder entries? They've recently been exposed https://github.com/adobecom/milo/pull/2737/files

@mokimo yes, because this is for MEP specific placeholders that are being introduced by the manifests. They are not part of the retreived placeholders.

@mokimo
Copy link
Contributor

mokimo commented Aug 27, 2024

There are some unit tests / linting failing, other than that IMO this looks good and can be approved after that's fixed 👍

@AdobeLinhart AdobeLinhart added verified PR has been E2E tested by a reviewer run-nala Run Nala Test Automation against PR labels Aug 28, 2024
@vgoodric vgoodric requested a review from a team August 28, 2024 21:51
@vgoodric
Copy link
Contributor

@mokimo can you review and lift request change if you are satisfied?

export async function createMartechMetadata(placeholders, config, column) {
if (config.locale.ietf === 'en-US') return;

await import('../../martech/attributes.js').then(({ processTrackingLabels }) => {
Copy link
Contributor

@mokimo mokimo Aug 29, 2024

Choose a reason for hiding this comment

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

I'd be a bit careful with those imports as they block the pipeline and we aren't loading things in parallel.

Copy link
Contributor

Choose a reason for hiding this comment

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

Here's a bit of a case-study I did on project unity on this: adobecom/unity#102

@milo-pr-merge milo-pr-merge bot merged commit 47dea19 into stage Sep 3, 2024
24 checks passed
@milo-pr-merge milo-pr-merge bot deleted the geometadata branch September 3, 2024 08:13
@milo-pr-merge milo-pr-merge bot mentioned this pull request Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready for Stage run-nala Run Nala Test Automation against PR verified PR has been E2E tested by a reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants