Since: 1.38.0
Create Pages
Call +[FS pageWithName:]
to create a new FSPage instance for a page of type pageName
.
This object will be used to instrument the start and end of views of the page
and to update the page's properties. You MUST call -[FSPage start]
after
creating the page to signal the start of the view of the page.
Nested pages are not supported. There will only ever be one (or zero) page(s)
active at a time, which will be the page that was most recently start
-ed (but
not end
-ed).
If you want to call -[FSPage updateProperties:]
or -[FSPage end]
on the page, you
would typically call this method to create the FSPage
once for a given
UIViewController
or View
instance, before the first time the view appears.
However, if you have no need to call these methods, you may simply call
[[FS pageWithName:@"<name>" properties:<properties>] start]
when the view appears
(see Start Page for more information).
Parameters
The name of the page.
A Dictionary containing properties of the page that will be indexed by Fullstory.
Conventions
Use constant values when choosing a pageName
and put dynamic or
differentiating info in the properties. For example, instead of having a
"merchantX" page for each merchant in an e‑commerce app, use
"Merchant" as the pageName
and add "merchantName": "merchantX" as a page
property. Use properties for values you would want to search on. See
Limits below.
Limits
- Capture up to 50 unique properties (exclusive of
pageName
) on a single page. - Capture up to 500 unique properties across all pages.
- The
pageName
field is limited to 1,000 unique values. Any newpageName
values sent past this limit will be ignored.
Additional Information
- Objective-C
- Swift
(id<FSPage>)pageWithName:(NSString *)pageName;
(id<FSPage>)pageWithName:(NSString *)pageName properties:(NSDictionary<NSString *, id> * _Nullable)properties;
@protocol FSPage <NSObject>
⋮
@end
Example Invocations
Create an FSPage for a homepage without properties
id<FSPage> _page;
- (void)viewDidLoad {
[super viewDidLoad];
_page = [FS pageWithName:@"Home"];
}
Create an FSPage for an e‑commerce product page with properties
id<FSPage> _page;
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
// Using viewDidAppear here in this example instead of viewDidLoad.
// Check if page is set yet so it's only created once.
if (_page == nil) {
_page = [FS pageWithName:@"Product" properties:@{
@"productId": @"798ith22928347",
@"category": @"Clothing",
@"name": @"Button Front Cardigan",
@"brand": @"Bright & Bold",
@"variants": @[ @"Blue", @"Red", @"White" ],
@"url": @"https://www.example.com/product/path"
}];
}
}
class func page(withName pageName: String) -> FSPage
class func page(withName pageName: String, properties: [String : Any]?) -> FSPage
protocol FSPage { … }
Example Invocations
Create an FSPage for a homepage without properties
private let page = FS.page(withName: "Home")
Create an FSPage for an e‑commerce product page with properties
private var page: FSPage?
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
// Using viewDidAppear here in this example instead of viewDidLoad.
// Check if page is set yet so it's only created once.
if (page == nil) {
page = FS.page(withName: "Product", properties: [
"productId": "798ith22928347",
"category": "Clothing",
"name": "Button Front Cardigan",
"brand": "Bright & Bold",
"variants": ["Blue", "Red", "White"],
"url": "https://www.example.com/product/path"
])
}
}