-
Notifications
You must be signed in to change notification settings - Fork 179
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
Add filter to allow custom attributes on Web Stories rendering #10005
Add filter to allow custom attributes on Web Stories rendering #10005
Conversation
Thanks for for your contribution! Please note that you'll need to sign the Contributor License Agreement before we could accept it. I'm curious to learn more about this analytics solution you are using. What kind of attributes do you need to set? For the stories embeds we actually prevent clicks on the As for the filter, are all the arguments necessary for your integration to work? Or do you perhaps only need the story object as context? |
hey @swissspidy, No worries I just signed. Thank you for looking into this. We have Adobe Analytics as our main Analytics solution. The These are the exact attributes the Analytics team has passed to us and asked to be implemented. The reason why we have 3 parameters is because we do use the order + widget name/id as If you would like to see this live you can go on https://www.theaustralian.com.au/ and scroll down or search for "Visual Stories". If I'm honest I'm unaware how Adobe Analytics work in detail and if this could be handled any other way. I'm happy to raise with the Analytics team though. What are your main concerns around this addition? A potentially very specific use case? Thanks! |
Awesome, thanks a lot for the context! The use case does sound reasonable for sure, no concerns there 🙂 I assume you have heard from the Analytics team already that this works like intended? I am asking because there seem to be some styling issues with the Web Stories embeds currently that prevent the clicks from being tracked properly. Something that we'll need to fix in the plugin asap. Right now the If you run |
…one_attr to escape attributes properly
Context
We want to be able to add custom attributes to the
a
tag when Web Stories Widgets are added to a page.Our use case is that we also have another Analytics platform that isn't Google Analytics and this is the way we thought to integrate.
Summary
We are adding a filter called
story_render_attributes
passing 3 different parameters to it,$this->current
which is an instance of theStory
object, itsposition
and theget_view_type
which is driven by the widget selected.Relevant Technical Choices
We thought that a filter would be the most appropriated way to achieve that.
To-do
None I can think of at this stage but let's see what the contributors think and if they have any other ideas.
User-facing changes
None, this is transparent for users.
Testing Instructions
We do have this patch current implemented live with the filter been added on our end (outside this plugin). It's not on our best interests though to have a modified version of this plugin in our codebase as it will be a problem to update as you release new functionalities. I hope this can be useful for other use cases as well.
This PR can be tested by following these steps:
Reviews
Does this PR have a security-related impact?
Does this PR change what data or activity we track or use?
Does this PR have a legal-related impact?
Checklist
Type: XYZ
label to the PRFixes #