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

feat: Support page level full redirection #43

Merged
merged 6 commits into from
Aug 14, 2024
Merged

feat: Support page level full redirection #43

merged 6 commits into from
Aug 14, 2024

Conversation

FentPams
Copy link
Contributor

@FentPams FentPams commented Aug 13, 2024

Description

The aim is to run full-page experimentation and personalization use cases that fully redirect to the target URL instead of just replacing the content for a marketer.

The new properties are introduced:

Experiment Resolution | redirect
Audience Resolution   | redirect
Campaign Resolution   | redirect
Screenshot 2024-08-13 at 7 44 24 AM

When simulate the variant, rather than 'replace' the page, url is redirected by calling window.location.replace(url) API

Screenshot 2024-08-13 at 7 45 59 AM

How Has This Been Tested?

Test link:

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@FentPams FentPams changed the base branch from main to v2 August 13, 2024 14:55
@FentPams FentPams marked this pull request as ready for review August 13, 2024 14:57
@FentPams
Copy link
Contributor Author

@ramboz Could you help review this? Please let me know where I could improve. Thank you :)

Copy link
Contributor

@ramboz ramboz left a comment

Choose a reason for hiding this comment

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

A few minor fine-tuning comments, but otherwise all good 👍

src/index.js Outdated Show resolved Hide resolved
src/index.js Show resolved Hide resolved
Copy link

codecov bot commented Aug 14, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 5 lines in your changes missing coverage. Please review.

Please upload report for BASE (v2@942948d). Learn more about missing BASE report.

Files Patch % Lines
src/index.js 83.33% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##             v2      #43   +/-   ##
=====================================
  Coverage      ?   92.89%           
=====================================
  Files         ?        1           
  Lines         ?      704           
  Branches      ?       12           
=====================================
  Hits          ?      654           
  Misses        ?       38           
  Partials      ?       12           

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

@FentPams
Copy link
Contributor Author

FentPams commented Aug 14, 2024

@ramboz Could you help review this again? Thank you :)

I realized the test failures were caused by the fireRUM function. Initially, I defined all configurations upfront—experiment, campaign, and audience—regardless of whether runExperiment, runCampaign, or serveAudience was calling it. To fix it, I refactored it to create configurations only when needed.

Also, I added this part into documentation 😀

And I figured out why my local npm test always fail all tests:

  1. My local repo was somehow messed up. 😅
  2. I have aem up when I run test, they are using the same port number...
    So, I re-clone the repo and never forget to stop the aem up before running test locally :) Now it works well.

documentation/experiments.md Show resolved Hide resolved
@FentPams FentPams merged commit 285011f into v2 Aug 14, 2024
5 checks passed
@FentPams FentPams deleted the redirect branch August 14, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants