# 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_collect_pii_toggle`](js/src/pages/settings/conversions-api/index.js#L26)
When Collect PII setting is toggled.
#### Properties
| name | type | description |
| ---- | ---- | ----------- |
`status` | `"on"\|"off"` | The status of the setting.
#### Emitters
- [`ConversionsAPI`](js/src/pages/settings/conversions-api/index.js#L45)

### [`sfw_conversion_tracking_toggle`](js/src/pages/settings/conversions-api/index.js#L19)
When Conversion tracking setting is toggled.
#### Properties
| name | type | description |
| ---- | ---- | ----------- |
`status` | `"on"\|"off"` | The status of the setting.
#### Emitters
- [`ConversionsAPI`](js/src/pages/settings/conversions-api/index.js#L45)

### [`sfw_disconnect_snapchat_button_click`](js/src/pages/settings/linked-accounts.js#L25)
When the "Disconnect Snapchat account" button is clicked.
#### Emitters
- [`exports`](js/src/pages/settings/linked-accounts.js#L35)

### [`sfw_disconnect_snapchat_confirm_modal_button_click`](js/src/pages/settings/disconnect-modal/confirm-modal.js#L63)
When the confirm "Disconnect Snapchat account" button is clicked inside the modal.
#### Emitters
- [`exports`](js/src/pages/settings/disconnect-modal/confirm-modal.js#L72)

### [`sfw_disconnected_accounts`](js/src/pages/settings/linked-accounts.js#L18)
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#L35)

### [`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)
- [`LegacyPluginActiveNotice`](js/src/components/legacy-plugin-active-notice/index.js#L27) with `{ context: "legacy-plugin-active-notice", link_id: "legacy-plugin-active-notice", href: "https://woocommerce.com/document/snapchat-for-woocommerce/#section-4" }`

### [`sfw_documentation_link_click`](js/src/components/legacy-plugin-active-notice/index.js#L14)
When the documentation link is clicked.
#### Emitters
- [`AppDocumentationLink`](js/src/components/app-documentation-link/index.js#L29)
- [`LegacyPluginActiveNotice`](js/src/components/legacy-plugin-active-notice/index.js#L27) with `{ context: "legacy-plugin-active-notice", link_id: "legacy-plugin-active-notice", href: "https://woocommerce.com/document/snapchat-for-woocommerce/#section-4" }`

### [`sfw_generate_csv_button_click`](js/src/pages/settings/product-catalog/index.js#L19)
When the `Generate CSV` button is clicked.
#### Emitters
- [`ProductCatalog`](js/src/pages/settings/product-catalog/index.js#L47)

### [`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_onboarding_completed`](js/src/pages/onboarding/setup-stepper/setup-accounts/index.js#L23)
When the merchant is onboarded.
#### Emitters
- [`SetupAccounts`](js/src/pages/onboarding/setup-stepper/setup-accounts/index.js#L32)

### [`sfw_regenerate_csv_button_click`](js/src/pages/settings/product-catalog/index.js#L25)
When the `Regenerate CSV` button is clicked.
#### Emitters
- [`ProductCatalog`](js/src/pages/settings/product-catalog/index.js#L47)

### [`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)

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