How to define a index-independent custom Axis ID


assuming I have multiple datasets. Each dateset/trace should find the corresponding y-axis by an id, without knowing the index of this axis (y,y2,y3, … ).
What are the possibilities so far? How can I assign an index-independent id to a Y-axis?
What are the best practices without much effort?

Thanks again for your help!