add `store`, `restore`, and `stub`, and pass analytics object in