Comments (4)
@trieloff A few suggested changes:
- set the
window.helix.audience
variable to the selected ID
I would (re)use window.hlx
object for this which is already being used by the Sidekick. On the other hand, do we really need this variable if the selected audience is also broadcast via event and stored in localStorage
?
- fire a
window.helix.on('audiencechanged')
event
I would propose to fire the event on the window
instead, as listening to an event on an object that may or may not exist (before the Sidekick is initialized, window.hlx
yet would be cumbersome:
window.dispatchEvent(new CustomEvent('helix-audiencechanged`, { detail: audienceId }));
Then blocks can register listeners like this:
window.addEventListener('helix-audiencechanged', (evt) => console.log(evt.detail);
And a few questions:
- Who is the persona authoring the
_audiences
sheet, and where would they get the correct IDs from? - In the production (i.e. non-simulation) scenario, where would the event be fired and the audience ID be stored in
localStorage
? I imagine we'd need a few helper functions to trigger this in a project'smartech.js
based on real data from EC...
from helix-sidekick.
I agree with the first sentence of the issue description: we need a button in the sidekick. For the rest, I do not know. Talking about implementation details of the simulation without having defined the things which need to be simulated feels strange to me ;)
And apart from the button, I am also not sure if this really belongs to the sidekick.
I am going to create an issue for the personalised content.
from helix-sidekick.
Who is the persona authoring the _audiences sheet, and where would they get the correct IDs from?
The same person that defines audiences in AudienceManager. They get it from the AudienceManager UI.
In the production (i.e. non-simulation) scenario, where would the event be fired and the audience ID be stored in localStorage? I imagine we'd need a few helper functions to trigger this in a project's martech.js based on real data from EC...
On the other hand, do we really need this variable if the selected audience is also broadcast via event and stored in localStorage?
Oddly enough, this is the same question, asked twice.
The window.hlx.audience
variable + helix-audiencechanged
event shall be the main interface to use when building a compontent that interacts with audiences or uses targeting. The value will be populated from two sources:
- the AudienceManager JSON API (by using the Experience Cloud ID Cookie)
- the Cookie/LocalStorage/Sidekick UI
(2) overrides (1), so that a user with the sidekick can select audiences at any time.
from helix-sidekick.
Oddly enough, this is the same question, asked twice.
Sorry 😄
I figured we'd need some sot of "connecive tissue" between Audience Manager running on a page and blocks using personalization, to make sure that window.hlx.audience
is set and/or the helix-audiencechanged
event gets fired...
from helix-sidekick.
Related Issues (20)
- Load config.js from outer CDN HOT 1
- Do not push down content by default HOT 1
- 404 handling HOT 1
- Permission handling HOT 2
- DOMException: Failed to execute 'attachShadow' on 'Element' HOT 1
- Dropdown as plugin container HOT 1
- Preview button click seems to hang before "Please wait..." message appears HOT 1
- Default to *.hlx.page HOT 1
- [i18n] Missing French translation of View HOT 1
- Improve help UX HOT 1
- Prevent preview update if webPath is undefined HOT 1
- Advanced mode HOT 1
- Show update indicator on preview button in editor HOT 1
- Clarify sign in HOT 1
- Enable sidekick publish on files in `.helix/` HOT 7
- Manifest v3: move source to @adobe/helix-sidekick-extension HOT 1
- Support for custom SharePoint domains HOT 1
- Add support for PDF in SharePoint HOT 1
- Preview fails if document has just been renamed HOT 1
- Rebrand to Franklin Sidekick HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from helix-sidekick.