The Comscore analytics package should allow to integrate Comscore with your site by just adding the client id. It’s one of the most used analytics services, especially for big publishers.
User Stories
As a Frontity user
I want to integrate Comscore in my project
so that I can use Comscore to monitor pageviews in my site.
Possible solution
The implementation would be very similar to the current beta of @frontity/google-analytics. It would need a component that adds the Comscore’s code snippet in SSR and a sendPageview action that would use the Comscore library to send pageviews.
The only difference is that Comscore doesn’t send events.
The first stable version for the @frontity/comscore-analytics package is ready!
There are not breaking changes for this package, as the settings for the frontity users remain the same, but it now uses the new version of the analytics library under the hood.
The package was adapted to use the new version of @frontity/analytics and the following changes were made:
sendPageview were renamed to pageview.
Its namespace is comscoreAnalytics.
The properties state.comscoreAnalytics.trackingId or state.comscoreAnalytics.trackingIds properties are used to specify the tracking IDs used by the package.
{
state: {
comscoreAnalytics: {
// If you only specify a single tracking ID
trackingId: "34567890",
// If you want to use a list of tracking IDs
trackingId: ["34567890", "56789012"]
}
}
}
The pageview action doesn’t receive any property, it sends the current link and title to all traking IDs defined in the properties mentioned before. The @frontity/analytics library ensures this action is called when the title is ready for the current page.
actions.comscoreAnalytics.pageview();
This action is called automatically if state.analytics.pageviews.comscoreAnalytics is set to true.