# @frontity/comscore-analytics

[Comscore](https://www.comscore.com/) Analytics package for Frontity.

## Table of Contents

* [Install](/frontity-packages/features-packages/analytics/comscore-analytics.md#install)
* [Settings](/frontity-packages/features-packages/analytics/comscore-analytics.md#settings)
* [Usage](/frontity-packages/features-packages/analytics/comscore-analytics.md#usage)
  * [`actions.analytics.pageview`](/frontity-packages/features-packages/analytics/comscore-analytics.md#actions-analytics-pageview)
  * [`actions.analytics.event`](/frontity-packages/features-packages/analytics/comscore-analytics.md#actions-analytics-event)

## Install

```bash
npm i @frontity/comscore-analytics
```

## Settings

The [namespace](https://docs.frontity.org/learning-frontity/namespaces) for this package is **`comscoreAnalytics`**.

Every Comscore account has a Tracking ID. To connect the package with a specific account (or accounts) set the following properties in the `frontity.settings.js` file:

* `state.comscoreAnalytics.trackingId`: to specify just one *tracking ID*
* `state.comscoreAnalytics.trackingIds`: to specify a list of *tracking ID's*

```javascript
export default {
  packages: [
    {
      name: "@frontity/comscore-analytics",
      state: {
        comscoreAnalytics: {
          trackingId: "34567890",
        },
      },
    },
  ],
};
```

```javascript
export default {
  packages: [
    {
      name: "@frontity/google-tag-manager-analytics",
      state: {
        comscoreAnalytics: {
          trackingIds: ["34567890", "56789012"],
        },
      },
    },
  ],
};
```

## Usage

The `@frontity/comscore-analytics` package can co-exist with any of the other `analytics` packages such as [`@frontity/google-analytics`](/frontity-packages/features-packages/analytics/google-analytics.md) and [`@frontity/google-tag-manager-analytics`](https://github.com/frontity/api-reference/tree/899877d910081ad463d808f44a7690d6378d0118/docs-api/frontity-packages/features-packages/analytics/gootle-tag-manager-analytics.md). Once these `analytics` packages have been properly installed and configured their actions will be centralized by the `analytics` namespace.

* `actions.analytics.pageview` will take into account settings in `state.analytics.pageviews`
* `actions.analytics.event` will take into account settings in `state.analytics.events`

> Read more about how to use Analytic packages [here](/frontity-packages/features-packages/analytics.md#how-to-use).

### `actions.analytics.pageview`

If `@frontity/comscore-analytics` is configured [and enabled for *pageviews*](https://api.frontity.org/frontity-packages/features-packages/analytics#actions-analytics-pageview), every time a link changes (or every time `action.router.set(link)` is launched) tracking information for that page will be sent to Google Analytics.

### `actions.analytics.event`

This package doesn't actually track events for Comscore so any call of the method `actions.analytics.event()` will have no effect for this service.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api.frontity.org/frontity-packages/features-packages/analytics/comscore-analytics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
