Skip to content

New Components: StickyNSG & StickyPrepopulation#347

Merged
fernanDOTdo merged 10 commits into
mainfrom
sticky-nsg
Mar 19, 2026
Merged

New Components: StickyNSG & StickyPrepopulation#347
fernanDOTdo merged 10 commits into
mainfrom
sticky-nsg

Conversation

@MichaelT372

@MichaelT372 MichaelT372 commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

StickyNSG

A new component Sticky NSG. It is turned off by default and needs to be enabled in ENgridOptions to run.

When enabled, it adds the following functionality:

  • When someone loads a page with an NSG value active, save those values into a cookie, unless skipstickynsg=true is in the URL.
  • On subsequent page loads, if there isn't an NSG value from EN, it applies the one we stored in our cookie. This uses the "SwapAmounts" ENgrid component.
  • When a gift process is completed, it deletes the cookie.

You can test it on this page: https://support.savingplaces.org/page/88286/donate/1?debug=log

To set yourself some NSG values, go into the page build and uncomment the "set suggestGift values" code block, then load the page. The comment in out again and reload the page to test the Sticky NSG functionality.

Documentation: https://engrid.4sitestudios.com/docs/v2/sticky-nsg

StickyPrepopulation

Another new component StickyPrepopulation. It is also turned off by default and requires being given a set of fields in EngridOptions to run.

The component is intended to "sticky" the prepopulation of fields when coming from a campaign link. By default, EN only prefills from the first click.

What we do is:

  • When the user lands on the page from a campaign link, we encrypt and save their data for the configured fields into a cookie, with a expiration of 7 days.
  • When the user revisits the same page, we will prepopulate the configured fields with that data. It only works on the same page.
  • If the user completes a gift, we clear the cookie. Or it expires in 7 days.

This component will not run if the RememberMe component is configured in the client theme.

You can test it on this page: https://support.savingplaces.org/page/88286/donate/1?debug=log

You'll need to send yourself a test email through EN to get a campaign link to set the cookie. I noticed test emails now always set your campaign link data, even through multiple clicks, so you should test it by refreshing the page after the first click.

Documentation: https://engrid.4sitestudios.com/docs/v2/sticky-prepopulation

@MichaelT372 MichaelT372 changed the title New Component: Sticky NSG New Components: StickyNSG & StickyPrepopulation Sep 18, 2025
@MichaelT372

Copy link
Copy Markdown
Contributor Author

This is ready for review and merge now

@fernanDOTdo
fernanDOTdo merged commit 895924e into main Mar 19, 2026
2 checks passed
@fernanDOTdo
fernanDOTdo deleted the sticky-nsg branch March 19, 2026 19:08
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