recordRef static method
Record the referral source (from ?ref= query parameter).
Implementation
static Future<void> recordRef(String stateId, String ref) async {
await _col.doc(stateId).set({
'refs.$ref': FieldValue.increment(1),
}, SetOptions(merge: true));
}