# Usage Tracking

_Snapchat for WooCommerce_ implements usage tracking, based on the native [WooCommerce Usage Tracking](https://woocommerce.com/usage-tracking/), and is only enabled when WooCommerce Tracking is enabled.

When a store opts in to WooCommerce usage tracking and uses _Snapchat for WooCommerce_, they will also be opted in to the tracking added by _Snapchat for WooCommerce_.

## What is tracked

As in WooCommerce core, only non-sensitive data about how a store is set up and managed is tracked. We **do not track or store personal data** from your clients.

-   Plugin version
-   Settings
	-   Snapchat account connection status

<!-- TODO: add more tracking information -->

### Tracking events

All event names are prefixed by `wcadmin_`.

### Global event properties

Most events have the following properties:

- `sfw_version`: Plugin version

<!-- -- >
## Developer Info
All new tracking info should be updated in this readme.

New snapshot data for **WC Tracker** should be hooked into `Tracking\Events\TrackerSnapshot::include_snapshot_data()`.

New **Tracks** events should be created in `Tracking\Events\Events` (extending `Tracking\Events\BaseEvent`), and need to be registered in `Tracking\Events\EventTracking::$events`. They should also be registered in the `Internal\DependencyManagement\CoreServiceProvider` class:

```php
$this->conditionally_share_with_tags( Loaded::class );
```

 /Dev Info -->

<woocommerce-grow-tracking-jsdoc>
<!---
Everything below will be automatically generated by `woocommerce-grow-tracking-jsdoc`.
Do not edit it manually!
-->

### [`sfw_disconnected_accounts`](js/src/pages/settings/linked-accounts.js#L17)
Accounts are disconnected from the Setting page
#### Properties
| name | type | description |
| ---- | ---- | ----------- |
`context` | `string` | (`all-accounts`\|`snapchat-account`) - indicate which accounts have been disconnected.
#### Emitters
- [`exports`](js/src/pages/settings/linked-accounts.js#L27)

### [`sfw_documentation_link_click`](js/src/components/app-documentation-link/index.js#L6)
When a documentation link is clicked.
#### Properties
| name | type | description |
| ---- | ---- | ----------- |
`link_id` | `string` | link identifier
`context` | `string` | indicate which link is clicked
`href` | `string` | link's URL
#### Emitters
- [`AppDocumentationLink`](js/src/components/app-documentation-link/index.js#L29)

### [`sfw_help_click`](js/src/components/help-icon-button/index.js#L13)
"Help" button is clicked.
#### Properties
| name | type | description |
| ---- | ---- | ----------- |
`context` | `string` | Indicates the place where the button is located, e.g. `setup-ads`.
#### Emitters
- [`HelpIconButton`](js/src/components/help-icon-button/index.js#L31)

### [`sfw_snapchat_account_connect_button_click`](js/src/components/snapchat-account-card/connect-snapchat-account-card.js#L19)
Clicking on the button to connect a Snapchat account.
#### Properties
| name | type | description |
| ---- | ---- | ----------- |
`context` | `string` | (`setup-snapchat`\|`reconnect`) - indicates from which page the button was clicked.
#### Emitters
- [`ConnectSnapchatAccountCard`](js/src/components/snapchat-account-card/connect-snapchat-account-card.js#L29)

### [`sfw_snapchat_account_connect_different_account_button_click`](js/src/components/snapchat-account-card/switch-account-button.js#L12)
Clicking on the "connect to a different Snapchat account" button.
#### Emitters
- [`SwitchAccountButton`](js/src/components/snapchat-account-card/switch-account-button.js#L25)

### [`sfw_wordpress_account_connect_button_click`](js/src/components/wpcom-account-card/connect-wpcom-account-card.js#L17)
Clicking on the button to connect WordPress.com account.
#### Properties
| name | type | description |
| ---- | ---- | ----------- |
`context` | `string` | (`setup-mc`\|`reconnect`) - indicates from which page the button was clicked.
#### Emitters
- [`ConnectWPComAccountCard`](js/src/components/wpcom-account-card/connect-wpcom-account-card.js#L27)

### [`sfw_onboarding_completed`](js/src/pages/onboarding/setup-stepper/setup-accounts.js#23)
When the merchant is onboarded.
#### Emitters
- [`SetupAccounts`](js/src/pages/onboarding/setup-stepper/setup-accounts.js#33)

### [`sfw_conversion_tracking_toggle`](js/src/pages/settings/conversions-api/index.js#19)
When Conversion tracking setting is toggled.
#### Emitters
- [`ConversionsAPI`](js/src/pages/settings/conversions-api/index.js#45)

### [`sfw_collect_pii_toggle`](js/src/pages/settings/conversions-api/index.js#19)
When Collect PII setting is toggled.
#### Emitters
- [`ConversionsAPI`](js/src/pages/settings/conversions-api/index.js#45)

### [`sfw_disconnect_snapchat_confirm_button_click`](js/src/pages/settings/disconnect-modal/confirm-modal.js#63)
By clicking the confirm "Disconnect Snapchat account" button inside the modal.
#### Emitters
- [`ConfirmModal`](js/src/pages/settings/disconnect-modal/confirm-modal.js#72)

### [`sfw_disconnect_snapchat_button_click`](js/src/pages/settings/linked-accounts.js#25)
By clicking the confirm "Disconnect Snapchat account" button in the Settings screen.
#### Emitters
- [`LinkedAccounts`](js/src/pages/settings/linked-accounts.js#35)

## [`sfw_regenerate_csv_button_click`](js/src/pages/settings/product-catalog/index.js#25)
By clicking the the Regenerate CSV button in the Settings screen.
#### Properties
| name | type | description |
| ---- | ---- | ----------- |
`context` | `string` | (`settings`) - indicates from which page the button was clicked.
#### Emitters
- [`ProductCatalog`](js/src/pages/settings/product-catalog/index.js#47)

## [`sfw_generate_csv_button_click`](js/src/pages/settings/product-catalog/index.js#19)
By clicking the the Generate CSV button in the Settings screen.
#### Properties
| name | type | description |
| ---- | ---- | ----------- |
`context` | `string` | (`settings`) - indicates from which page the button was clicked.
#### Emitters
- [`ProductCatalog`](js/src/pages/settings/product-catalog/index.js#47)

<!---
End of `woocommerce-grow-tracking-jsdoc`-generated content.
-->
</woocommerce-grow-tracking-jsdoc>
