getUniqueViewsByUser

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

Props:

<VeltViewAnalytics />
// or
<VeltViewAnalytics type="location" location-id="MY_LOCATION_ID" />

Using Hooks:

const viewsByUser = useUniqueViewsByUser();
const viewsByUserForLocation = useUniqueViewsByUser('your-location-id');

API Methods:

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:

subscription?.unsubscribe()

getUniqueViewsByDate

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

Props:

<VeltViewAnalytics />
// or
<VeltViewAnalytics type="location" location-id="MY_LOCATION_ID" />

Using Hooks:

const viewsByDate = useUniqueViewsByDate();
const viewsByDateForLocation = useUniqueViewsByDate('your-location-id');

API Methods:

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:

subscription?.unsubscribe()