> ## Documentation Index
> Fetch the complete documentation index at: https://velt.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Customize Behavior

## getUniqueViewsByUser

* Get unique views by user.
* You can optionally filter by location.

> [tab] React / Next.js
>
> Props:
>
> ```jsx theme={null}
> <VeltViewAnalytics />
> // or
> <VeltViewAnalytics type="location" location-id="MY_LOCATION_ID" />
> ```
>
> Using Hooks:
>
> ```jsx theme={null}
> const viewsByUser = useUniqueViewsByUser();
> const viewsByUserForLocation = useUniqueViewsByUser('your-location-id');
> ```
>
> API Methods:
>
> ```jsx theme={null}
> const viewsElement = client.getViewsElement();
> // to get unique views by user
> let subscription = viewsElement.getUniqueViewsByUser().subscribe((viewsByUser) => {
> 	console.log('Unique views by user: ', viewsByUser);
> });
> // you can optionally pass client-location-id to get unique views by users for that location
> let subscription = viewsElement.getUniqueViewsByUser('your-location-id').subscribe((viewsByUser) => {
> 	console.log('Unique views by date for location: ', viewsByUser);
> });
> ```
>
> To unsubscribe from the subscription:
>
> ```jsx theme={null}
> subscription?.unsubscribe()
> ```

> [tab] Other Frameworks
>
> Props:
>
> ```html theme={null}
> <velt-view-analytics></velt-view-analytics>
> <!-- or -->
> <velt-view-analytics
> 	type="location"
> 	location-id="your-location-id">
> </velt-view-analytics>
> ```
>
> Using Hooks:
>
> ```jsx theme={null}
> const viewsByUser = useUniqueViewsByUser();
> const viewsByUserForLocation = useUniqueViewsByUser('your-location-id');
> ```
>
> API Methods:
>
> ```jsx theme={null}
> const viewsElement = client.getViewsElement();
> // to get unique views by user
> let subscription = viewsElement.getUniqueViewsByUser().subscribe((viewsByUser) => {
> 	console.log('Unique views by user: ', viewsByUser);
> });
> // you can optionally pass client-location-id to get unique views by users for that location
> let subscription = viewsElement.getUniqueViewsByUser('your-location-id').subscribe((viewsByUser) => {
> 	console.log('Unique views by date for location: ', viewsByUser);
> });
> ```
>
> To unsubscribe from the subscription:
>
> ```jsx theme={null}
> subscription?.unsubscribe()
> ```

## getUniqueViewsByDate

* Get unique views by date.
* You can optionally filter by location.

> [tab] React / Next.js
>
> Props:
>
> ```jsx theme={null}
> <VeltViewAnalytics />
> // or
> <VeltViewAnalytics type="location" location-id="MY_LOCATION_ID" />
> ```
>
> Using Hooks:
>
> ```jsx theme={null}
> const viewsByDate = useUniqueViewsByDate();
> const viewsByDateForLocation = useUniqueViewsByDate('your-location-id');
> ```
>
> API Methods:
>
> ```jsx theme={null}
> const viewsElement = client.getViewsElement();
> // to get unique views by date
> let subscription = viewsElement.getUniqueViewsByDate().subscribe((viewsByDate) => {
> 	console.log('Unique views by date: ', viewsByDate);
> });
> // you can optionally pass client-location-id to get unique views by date for that location
> let subscription = viewsElement.getUniqueViewsByDate('your-location-id').subscribe((viewsByDate) => {
> 	console.log('Unique views by date for location: ', viewsByDate);
> });
> ```
>
> To unsubscribe from the subscription:
>
> ```jsx theme={null}
> subscription?.unsubscribe()
> ```

> [tab] Other Frameworks
>
> Props:
>
> ```html theme={null}
> <velt-view-analytics></velt-view-analytics>
> <!-- or -->
> <velt-view-analytics
> 	type="location"
> 	location-id="your-location-id">
> </velt-view-analytics>
> ```
>
> Using Hooks:
>
> ```jsx theme={null}
> const viewsByDate = useUniqueViewsByDate();
> const viewsByDateForLocation = useUniqueViewsByDate('your-location-id');
> ```
>
> API Methods:
>
> ```jsx theme={null}
> const viewsElement = client.getViewsElement();
> // to get unique views by date
> let subscription = viewsElement.getUniqueViewsByDate().subscribe((viewsByDate) => {
> 	console.log('Unique views by date: ', viewsByDate);
> });
> // you can optionally pass client-location-id to get unique views by date for that location
> let subscription = viewsElement.getUniqueViewsByDate('your-location-id').subscribe((viewsByDate) => {
> 	console.log('Unique views by date for location: ', viewsByDate);
> });
> ```
>
> To unsubscribe from the subscription:
>
> ```jsx theme={null}
> subscription?.unsubscribe()
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.