Hi @priyankagupta20 , If the button is common in both experiences and if you defined onclick as a goal then it should work for both.
Can you please check your settings again and if possible can you share the screen shots.
Please validate the experiences using activity QA.
Thanks.
Pradnya