- 2 Minutes to read
- Print
- DarkLight
Pages
- 2 Minutes to read
- Print
- DarkLight
It is possible to track additional page information to each page view. This allows for better and more granular analyses in Intelligence.
Parameter Constants
The following parameters are mandatory and can be configured in the MIPageViewEvent() object:
Parameter | Description | Where to configure (Mapp Q3 > Configuration > ...) | Where to analyze |
---|---|---|---|
name | Name of the page/screen. You can either use a custom name (name: "custom name") or the name of the view controller (with: self). | - | Navigation > Pages > Pages Datatype Figure: metric |
The following parameters are optional can be configured in the MIPageParameters() object:
Parameter | Description | Where to configure (Mapp Q3 > Configuration > ...) | Where to analyze |
---|---|---|---|
pageCategory | Page categories (called "Content Groups" in Mapp) are used to group pages to create website areas. | Categories > Content Groups > New Category | Datatype Text: Navigation > Content groups > [Name of Content group] Datatype Figure: metric |
pageParams | You can use parameters to enrich Analytics data with your own website-specific information and/or metrics. | Custom Parameters > Page Parameters > Create new Custom Parameter > Preconfigured > Own Configuration | Datatype Text: Navigation > Page Parameters > [Name of Parameter] Datatype Figure: metric |
search | Is used to track an internal search request in Intelligence. | - | Marketing > Search Phrases > Internal Search Phrases |
Methods for Pages
Method | Description |
---|---|
trackPage() | Used to track page requests in Intelligence. It is possible to track pages using the name of the current view controller (with: self) or a custom name (as specified in the MIPageViewEvent() object. Passing a name is mandatory. Optionally, you can add additional information, for example, page or session parameters. |
Example iOS
Please note that custom parameters are optional in the request.
Define all screen/page information you want to track:
let params:[NSNumber : String] = [20: "cp20Override"] let categories:NSMutableDictionary = [10: "test"] let searchTerm = "testSearchTerm" let pageParameters = MIPageParameters(pageParams: params, pageCategory: categories, search: searchTerm) let pageEvent = MIPageViewEvent(name: "the custom name of page") pageEvent.pageParameters = pageParameters
Call the trackPage method
// Use the above specified custom name as page name in Intelligence MappIntelligence.shared()?.trackPage(pageEvent) // Use the UIViewController class name as page name in Intelligence MappIntelligence.shared()?.trackPage(with: self, pageViewEvent: nil)
Full Code Example:
@IBAction func trackCustomPage(_ sender: Any) {
//page properties
let params:[NSNumber : String] = [20: "cp20Override"]
let categories:NSMutableDictionary = [10: "test"]
let searchTerm = "testSearchTerm"
let pageParameters = MIPageParameters(pageParams: params, pageCategory: categories, search: searchTerm)
let pageEvent = MIPageViewEvent(name: "the custom name of page")
pageEvent.pageParameters = pageParameters
MappIntelligence.shared()?.trackPage(pageEvent)
}
Define all screen/page information you want to track:
NSMutableDictionary* pageParams = [@{@20: @[@"cp20Override"]} copy]; NSMutableDictionary* categories = [@{@10: @[@"test"]} copy]; NSString* searchTerm = @"testSearchTerm"; MIPageParameters* pageParameters = [[MIPageParameters alloc] initWithPageParams:pageParams pageCategory:categories search:searchTerm]; MIPageViewEvent* pageEvent = [[MIPageViewEvent alloc] initWithName:@"the custom name of page"]; [pageEvent setPageParameters:pageParameters];
Call the trackPage method
// Use the above specified custom name as page name in Intelligence [[MappIntelligence shared] trackPage:pageEvent]; // Use the UIViewController class name as page name in Intelligence [[MappIntelligence shared] trackPageWithViewController:self pageViewEvent:nil];
Full Code Example:
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
NSMutableDictionary* pageParams = [@{@20: @[@"cp20Override"]} copy];
NSMutableDictionary* categories = [@{@10: @[@"test"]} copy];
NSString* searchTerm = @"testSearchTerm";
MIPageParameters* pageParameters = [[MIPageParameters alloc] initWithPageParams:pageParams pageCategory:categories search:searchTerm];
MIPageViewEvent* pageEvent = [[MIPageViewEvent alloc] initWithName:@"the custom name of page"];
[pageEvent setPageParameters:pageParameters];
[[MappIntelligence shared] trackPage:pageEvent];
}