Is there an easy way to store queries between route changes in IR?

A user comes to my site at I’d like to use XXX when the user signs up.

When he switches routes though, the query part of the route disappears, and by the time they sign up I’ve lost the referrerCode.

Is there an easy way to get around this problem?


You could just save it locally in a temporary fashion for the duration of their visit and just reference whenever you need it. You could use a global reactive variable like Session.

Yeah. I tried taking that approach.

I was using this pattern from the user-accounts package:

  _id: 'referrerCode',
  type: 'hidden'

Which expects referrerCode in the query, so was wondering if there was an easy way to keep it in the query.

Ah I see. Unfortunately I can’t help then, I’m not that familiar with IR.

Well this is the code from the user-accounts-core package that was making it work for me. I’ll just set the field myself from the saved variable.

AT.prototype.atInputRendered = function(){
    var fieldId =;
    var queryKey = && ||;
    var inputQueryVal = Router.current().params.query[queryKey];
    if (inputQueryVal)
        this.$("input#at-field-" + fieldId).val(inputQueryVal);