You can use the header redirect to send the user to another page or add in a variable that you will use for your ajax. This is on a higher level though but it should yield the same result if your goal is only to add in a variable. You will have the same issue with this part of the code being overwritten if you make any updates to the UE code though so keep that in mind.