# Precision Tracking

Precision Tracking is provided by the Freshpaint SDK web source and allows you to manually track your events with code. This is in contrast to [Autotrack](https://documentation.freshpaint.io/integrations/sources/web/javascript), which automatically collects certain events. If you want to maintain your event tracking in code or want to make sure you know *exactly* when an event will be fired, the precision tracking source is for you.

## Creating Precision Tracked Events

To create a precision tracked event, you call the `track` method provided by the Freshpaint SDK. As an example, the following bit of code sends a `login` event with the `username` property attached:

{% tabs %}
{% tab title="Web" %}

```javascript
freshpaint.track("login", {"username": "ada"});
```

{% endtab %}

{% tab title="React Native" %}

```javascript
freshpaint.track("login", {"username": "ada"});
```

{% endtab %}

{% tab title="iOS Swift" %}

```swift
Freshpaint.shared().track("login", properties: ["username": "ada"])
```

{% endtab %}

{% tab title="iOS Objective-C" %}

```objectivec
[[FPAnalytics sharedAnalytics]
              track:@"login" 
              properties:@{ @"username": @"ada" }];
```

{% endtab %}

{% tab title="Android" %}

```java
Freshpaint
    .with(getActivity().getApplicationContext())
    .track("login", new Properties().putValue("property", "value"));
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
If you are sending precision tracked events to a destination that does not accept anonymous events, make sure the user has been [identified](https://documentation.freshpaint.io/readme/setting-up-identify) with whatever identifier the destination requires prior to sending out the track call.
{% endhint %}

See the Freshpaint SDK references for more information on tracking events directly with code:

{% content-ref url="../../../reference/developer/freshpaint-sdk-reference" %}
[freshpaint-sdk-reference](https://documentation.freshpaint.io/reference/developer/freshpaint-sdk-reference)
{% endcontent-ref %}

{% content-ref url="../../../reference/developer/freshpaint-react-native-sdk-reference" %}
[freshpaint-react-native-sdk-reference](https://documentation.freshpaint.io/reference/developer/freshpaint-react-native-sdk-reference)
{% endcontent-ref %}

{% content-ref url="../../../reference/developer/freshpaint-ios-sdk-reference" %}
[freshpaint-ios-sdk-reference](https://documentation.freshpaint.io/reference/developer/freshpaint-ios-sdk-reference)
{% endcontent-ref %}

{% content-ref url="../../../reference/developer/freshpaint-android-sdk-reference" %}
[freshpaint-android-sdk-reference](https://documentation.freshpaint.io/reference/developer/freshpaint-android-sdk-reference)
{% endcontent-ref %}

## Naming Precision Tracking Events

There are some good practices to follow when naming your precision tracking events. Read [here](https://documentation.freshpaint.io/faqs/what-should-i-name-my-events#naming-precision-tracking-events) for more information on how your developers should name your precision tracking events.

## Precision Tracking Events and Destinations

By default, Precision Tracking Events will go to all of your active app destinations. You may not want this behavior if you are limited in the number of events you can send to a particular destination or if you would like to reduce clutter in a destination. If you world like this behavior turned off for future events, please contact Support at <support@freshpaint.io> to have this default behavior turned off.

For current events, you can turn this behavior off by going to the event definition in the event library, clicking the "settings" icon, and turning on the "Override hardcoded destinations" toggle:

<figure><img src="https://1666823438-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MA7aDqsXMFbUsWVqonF%2Fuploads%2F3FvegAA5RvxlAk91a8pF%2Fimage.png?alt=media&#x26;token=fd076440-a0ab-42dd-8b6e-47707b8ed6ee" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
This will turn off ALL active destinations for that particular event. You'll have to re-enable each destination you'd like that event to be sent to after enabling this option
{% endhint %}

{% hint style="danger" %}
Enabling 'override hardcoded destination' in the UI is not compatible with events sent from the [Freshpaint Google Tag Manager Integration](https://documentation.freshpaint.io/integrations/google-tag-manager-integration).
{% endhint %}

If you have a large number of events you'd like to turn this behavior off for,  please contact <support@freshpaint.io>.
