Closed benirose closed 4 years ago
If you agree with the idea of more descriptive errors when using a customTemplate, I can submit a PR with that change.
the error is correct, the thing is that by having a custom template like this you are making the error yourself by not passing the app_name. this is how I create the template
let template;
const customTemplate = pageTrackerTemplate(to, from);
if (customTemplate) {
template = customTemplate;
} else if (pageTrackerScreenviewEnabled) {
template = {
app_name: appName,
screen_name: to.name
};
} else {
template = {
page_title: to.name,
page_path: to.path,
page_location: window.location.href
};
}
so when you create the custom one, u are taking care of everything basically
sorry for the huge delay of the response 🙏
I was wrestling with this error for a bit:
To use the screenview, add the appName to the plugin options
with this configuration:After digging into the source code it became apparent, that the top level option of
appView
only gets set in the template if you're not using a custom one, otherwise you need to setapp_view
within yourpageTrackerTemplate
method. Would it make sense to report a different error if they have a custompageTrackerTemplate
that's missingapp_view
?