You'll want to replace the <YourTableauServer> tags with the IP or DNS Name of your Tableau Server. You'll also want to publish the workbook on your Tableau Server. Once done, you'll be able to click on the 'Save My View' button:
There are a few key functions you can see on the code:
1. initializeViz(): Creates and loads the dashboard in the HTML page.
2. listenToMarksSelection(): Adds an event listener to the dashboard, waiting for a user to interact with the viz.
3. onMarksSelection(marksEvent): Once a user clicks on a mark, check that the action came from the 'Save my View' button.
4. saveCustomView(): This saves the custom view for the user on Tableau Server.
5. saveAsDefault(view): Optionally, this sets the customer view as default.
That shoudl do it! Hope that helps!
Thank you Santiago. Solution works perfectly fine.