# What's the Last Visited field, and how do I use it?

You may have noticed that each person in your Customer.io account has a Last Visited field:

[![Person last visited 4 months ago](https://docs.customer.io/images/image%2887%29.png)](#ce8835bb7e62b1e91688cf6e9e920e76-lightbox)

If this field is *blank* in your account, there are several ways to set up and make use of it.

## Updating Last Visited with page views[](#updating-last-visited-with-page-views)

By default, the “Last Visited” attribute is updated based on [page view activity](/integrations/data-in/connections/javascript/method-reference/#page). For profiles where page views exist, we will update “Last Visited” accordingly.

Page views can be tracked using one of two options:

1.  Adding [our JavaScript snippet](/integrations/data-in/connections/javascript/) to each page you want to track. The snippet will automatically track page views on pages where the snippet is present.
2.  Making [event calls to our API](/integrations/api/track/#operation/track) with the `type` set to `page`.

### Sending page views for Last Visited via Segment[](#sending-page-views-for-last-visited-via-segment)

If you’re integrating with us via Segment, [their `page` call](https://segment.com/docs/connections/spec/page/) lets you record whenever a user sees a page of your website or app, and sends them to Customer.io. If you’re having trouble with this, we can help you troubleshoot! [Email us](mailto:win@customer.io) with the following:

*   The date and time (as precise as possible) of the API calls that were made.
*   The exact code & data used to call the API, ideally shared in a Gist or via Pastebin to keep formatting intact.
*   Some sample users that should have received the calls (their `id` and/or email).

## Updating last visited with mobile screen views[](#screen-view)

We automatically update your audience’s “Last Visited” attributes when you send `screen` events, indicating that someone opened a screen in your app.

You can track screen views by integrating with [our SDKs](/integrations/sdk/) or writing your own custom code to send events using the [Track API](/integrations/api/track/#operation/track). Our SDKs support automatic screen tracking, making it much easier to implement screen view events.

## Updating Last Visited by sending attributes[](#updating-last-visited-by-sending-attributes)

If you want to update the “Last Visited” field without relying on page views, you can also pass over the attribute `_last_visit` with the timestamp of the last visit in unix ([seconds since epoch format](https://www.epochconverter.com/)) when making `identify` calls to Customer.io through your integration.

Within Customer.io, you can do this within event triggered campaigns by adding an *Create or update person* action your workflow. For example, if I wanted “Last Visited” to update whenever a user last signed in and saw my app’s home page, this is how that might be set up:

[![image.png](https://docs.customer.io/images/image%2888%29.png)](#664e4be3f28f6888494e0547ec12ffd6-lightbox)

The trigger would be an event (signing in, viewing the page, or interacting with a certain interface element on that page, to name a few event examples), and the specific *Create or update person* action looks like this:

[![Update a person's attribute](https://docs.customer.io/images/last-visit-attribute.png)](#f4ddf9157fa54e26a1a2387b98a06c95-lightbox)

When the event occurs, the “Last Visited” field will be updated with that event’s timestamp– that’s what `{{event_timestamp}}`will do.

Note that this won’t be seen in a user’s Activity feed (because `_last_visit` is a special internal attribute), but their Last Visited field will update.

## Filtering/Segmenting by Last Visited[](#filteringsegmenting-by-last-visited)

You can’t segment on a last visited attribute directly. But if you’re tracking `page` or `screen` views, you can get a similar result by looking for people with a **Page** or **Screen** condition and use the **Refine** option to set a time frame.

 Page view

#### Page view[](#Page view)

[![Segment people by page view](https://docs.customer.io/images/segment-page-view.png)](#db42af71e912ec00a11fe48ce00d7617-lightbox)

 Screen view

#### Screen view[](#Screen view)

[![Segment people by screen view](https://docs.customer.io/images/segment-screen-view.png)](#5427eeeeae5c408e26bc77548ec113a0-lightbox)

Keep in mind that we can only match URLs or screens that your integration is sends in your `page` or `screen` events! We have a whole page to help you [segment based on page views](/integrations/data-in/connections/javascript/method-reference/#page) that can help set up the right conditions.