URL-Parameter in TWIG template

Dies anyone knows how to read URL parameters in Twig templates?

Example: On first page of a trip booking page I only show all trips and if there are available rooms. If the user select a trip he should select the room on a second page. Together with other options.

Current solution: I created a product matrix with all trips as rows. The rooms are columns. On the front a Twig template will render all trips with the info if there are available rooms. If the use clicks on a button he will redirected to the booking page. In the URL of the booking page parameters for the related matrix.id and row.id. On the booking page I placed the getMatrix snippet. But since the snippet doesn’t have a variable for the row I need a different solution to get the row.id. Any ideas?

Thanks