> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# UpdateTrackingSettings

# Package: emailMarketing

# Namespace: AccountDetailsService

# Method link: https://dev.wix.com/docs/api-reference/business-management/marketing/emails/email-marketing/account-details/update-tracking-settings.md

## Permission Scopes:
Manage Email Marketing: SCOPE.DC-PROMOTE.EMAIL-MARKETING

## Introduction

Updates a site's email tracking settings.

Tracking settings apply to the whole site, so they affect every email sent from it, including email marketing campaigns, automation emails, and triggered emails. This method is the only way to change tracking settings, and the updated values are returned in `accountDetails.trackingSettings` when you call [Get Account Details](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/email-marketing/account-details/get-account-details.md).

Disabling opens tracking doesn't affect click tracking, and it doesn't delete opens already recorded. Campaign statistics continue to report opens collected before the update.

---

## REST API

### Schema

```
 Method: updateTrackingSettings
 Description: Updates a site's email tracking settings.  Tracking settings apply to the whole site, so they affect every email sent from it, including email marketing campaigns, automation emails, and triggered emails. This method is the only way to change tracking settings, and the updated values are returned in `accountDetails.trackingSettings` when you call [Get Account Details](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/email-marketing/account-details/get-account-details.md).  Disabling opens tracking doesn't affect click tracking, and it doesn't delete opens already recorded. Campaign statistics continue to report opens collected before the update.
 URL: https://www.wixapis.com/email-marketing/v1/account-details/tracking-settings/update
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  trackingSettings, trackingSettings.opensTrackingEnabled
 Method parameters: 
   param name: trackingSettings | type: TrackingSettings | description: Site-level settings that control how engagement with the site's emails is tracked. | required: true 
        - name: opensTrackingEnabled | type: boolean | description: Whether email opens are tracked. When opens tracking is disabled, the tracking pixel isn't added to outgoing emails and new opens aren't recorded. Click tracking isn't affected.  Opens tracking is enabled for a site until it's explicitly disabled. | required: true 
 Return type: UpdateTrackingSettingsResponse
  EMPTY-OBJECT {}


```

### Examples

### Disable opens tracking
Stop recording email opens for every email sent from the site, including campaigns, automation emails, and triggered emails.

```curl
curl -X POST \
'https://www.wixapis.com/email-marketing/v1/account-details/tracking-settings/update' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "trackingSettings": {
    "opensTrackingEnabled": false
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.emailMarketing.accountDetails.updateTrackingSettings(trackingSettings)
 Description: Updates a site's email tracking settings.  Tracking settings apply to the whole site, so they affect every email sent from it, including email marketing campaigns, automation emails, and triggered emails. This method is the only way to change tracking settings, and the updated values are returned in `accountDetails.trackingSettings` when you call [Get Account Details](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/email-marketing/account-details/get-account-details.md).  Disabling opens tracking doesn't affect click tracking, and it doesn't delete opens already recorded. Campaign statistics continue to report opens collected before the update.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  trackingSettings, trackingSettings.opensTrackingEnabled
 Method parameters: 
   param name: trackingSettings | type: TrackingSettings | description: Site-level settings that control how engagement with the site's emails is tracked. | required: true 
        - name: opensTrackingEnabled | type: boolean | description: Whether email opens are tracked. When opens tracking is disabled, the tracking pixel isn't added to outgoing emails and new opens aren't recorded. Click tracking isn't affected.  Opens tracking is enabled for a site until it's explicitly disabled. | required: true 
 Return type: PROMISE<UpdateTrackingSettingsResponse>
  EMPTY-OBJECT {}


```

### Examples

### Disable opens tracking
Stop recording email opens for every email sent from the site, including campaigns, automation emails, and triggered emails.

```javascript
import { accountDetails } from "@wix/email-marketing";

export async function myUpdateTrackingSettingsFunction() {
  try {
    await accountDetails.updateTrackingSettings({
      opensTrackingEnabled: false,
    });

    console.log('Success! Opens tracking disabled.');
  } catch (error) {
    console.error(error);
  }
}

```

### updateTrackingSettings (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { accountDetails } from '@wix/email-marketing';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { accountDetails },
  // Include the auth strategy and host as relevant
});


async function updateTrackingSettings(trackingSettings) {
  const response = await myWixClient.accountDetails.updateTrackingSettings(trackingSettings);
};
```

---