Menu
 

Tracking Pageviews

Pageviews are recorded when a user visits a page within your app. Once you send us pageview data, you can segment your users based on pages they have or have not visited.

How do I send you pageview data?

Just add our Javascript snippet. We will track pageviews on any page where that snippet is present.

If you’re using our API, you can send us pageview events with code like:

curl -i https://track.customer.io/api/v1/customers/5/events \
-u YOUR-SITE-ID-HERE:YOUR-SECRET-API-KEY-HERE \
-d name=http://google.com/search \
-d type=page \
-d data[referrer]=http://google.com

How do I create pageview segments in Customer.io?

Within Segments, create a new pageview segment, like this:

pageview sample segment

You can create segments based on pages users have or have not viewed. By clicking Refine, you can also set a time frame for the viewing – e.g., “has not viewed in 30 days”, or “has viewed at least once”, like this:

pageview sample segment refined

Important things to know:

When you are defining the URL for a pageview:

  • To track a specific page, enter the full path, like this: http://customer.io/docs/pageviews.html

  • To track any page, use the asterisk *

  • You can also use * as a wildcard to match anything before or after a URL, just like in the above screenshot. For example, http://customer.io/docs/* will track any page within the docs sub-directory