How event tracking works on your flipbook when you add Google Analytics or Google Tag Manager integration.

Google Analytics

We track Pageviews (both initial load and if end user pages the flipbook) in Google Analytics. On top of that, we also track various Events across our flipbooks. Take a look at the list below for a full list of events.

Events

All events are tracked to the iPaper events category in the following format:

window.ga(tracker.get('name') + '.send', {
	hitType: 'event',
	eventCategory: 'iPaper events',
	eventAction: [ACTION],
	eventLabel: [LABEL]
});

Overview

Event name Data (conversion to eventLabel) Comment
External Link Click
{
  HoverText: [LINK_HOVER_TEXT],
  Url: [EXTERNAL_URL],
  Page: [PAGE_NUMBER]
}
n.a.
Load
{
  Url: [FLIPBOOK_URL]
}
Flipbook URL is simply read from window.location.href
PDF Download n.a. n.a.
Popup Image Click
{
  HoverText: [LINK_HOVER_TEXT],
  Url: [IMAGE_URL],
  Page: [PAGE_NUMBER]
}
n.a.
Popup Image Gallery Click
{
  HoverText: [LINK_HOVER_TEXT],
  Page: [PAGE_NUMBER]
}
n.a.
Popup Content Click
{
  HoverText: [LINK_HOVER_TEXT],
  Page: [PAGE_NUMBER]
}
n.a.
Popup Frame Click
{
  HoverText: [LINK_HOVER_TEXT],
  Url: [FRAME_URL],
  Page: [PAGE_NUMBER]
}
n.a.
Product Added to Basket
{
  Id: [PRODUCT_ID],
  Name: [PRODUCT_NAME],
  Page: [PAGE_NUMBER]
}
n.a.
Newsticker External Link Click
{
  Url: [EXTERNAL_URL]
}
n.a.
Search
{
  Term: [SEARCH_TERM]
}
n.a.
Shop Checkout
{
  NumberOfProducts: [NO_OF_PRODUCT_IN_CART],
  CheckoutType: [CHECKOUT_TYPE],
  BasketValue: [TOTAL_BASKET_VALUE]
}
Possible CheckoutType values are Email, ShareEmail, Checkout, or Print.
Video Play
{
  Url: [VIDEO_URL],
  VideoType: [VIDEO_TYPE],
  Page: [PAGE_NUMBER]
}
Only the first play is registered. Possible VideoType values are Video, YouTube, or Vimeo.

Example

For example, when somebody searches for “Cute puppies” in your flipbook, we will track it as such via the “Search” event:

window.ga(tracker.get('name') + '.send', {
	hitType: 'event',
	eventCategory: 'iPaper events',
	eventAction: 'Search',
	eventLabel: 'Term: Cute puppies'
});

If you need help setting up Google Analytics on your iPaper account, have a look at our Integrate Google Analytics With iPaper Google Analytics Tracking guide.

Google Tag Manager

Similar to Google Analytics, we track Pageviews (both initial load and if end user pages the flipbook) in Google Tag Manager. Pageviews on GTM are tracked as such:

window.dataLayer.push({
	event: 'virtualPageview',
	virtualPageUrl: [FLIPBOOK_PAGE_URL],
	virtualPageTitle: [FLIPBOOK_PAGE_TITLE],
});

On top of that, we also track various Events across our flipbooks.

Events

For all events we support, we’ll push the raw event data and the Category, Action and Label that we’d push to Google Analytics for the similar event.

For the events below we will push to the data layer in the following format

window.dataLayer.push({
	'event': [EVENT_NAME],
	'ipaperEventParams': [EVENT_DATA],
	'ipaperEventCategory': [GOOGLE_ANALYTICS_EVENT_CATEGORY],
	'ipaperEventAction': [GOOGLE_ANALYTICS_EVENT_ACTION],
	'ipaperEventLabel': [GOOGLE_ANALYTICS_EVENT_LABEL]
});

Overview

Event name Data (conversion to eventLabel) Comment
ipaperEvent_externalLinkClick
{
  HoverText: [LINK_HOVER_TEXT],
  Url: [EXTERNAL_URL],
  Page: [PAGE_NUMBER]
}
n.a.
ipaperEvent_load
{
  Url: [FLIPBOOK_URL]
}
Flipbook URL is simply read from window.location.href
ipaperEvent_PDFDownload n.a. n.a.
ipaperEvent_leadgenPopupOpen
{
  Name: [POPUP_NAME],
  Url: [CURRENT_URL]
}
n.a.
ipaperEvent_leadgenPopupConversion
{
  Name: [POPUP_NAME],
  Url: [CURRENT_URL]
}
n.a.
ipaperEvent_leadgenPopupConversionByUrlClick
{
  Name: [POPUP_NAME],
  Url: [CURRENT_URL]
}
n.a.
ipaperEvent_popupImageClick
{
  HoverText: [LINK_HOVER_TEXT],
  Url: [IMAGE_URL],
  Page: [PAGE_NUMBER]
}
n.a.
ipaperEvent_popupGalleryImageClick
{
  HoverText: [LINK_HOVER_TEXT],
  Page: [PAGE_NUMBER]
}
n.a.
ipaperEvent_popupContentClick
{
  HoverText: [LINK_HOVER_TEXT],
  Page: [PAGE_NUMBER]
}
n.a.
ipaperEvent_popupFrameClick
{
  HoverText: [LINK_HOVER_TEXT],
  Url: [FRAME_URL],
  Page: [PAGE_NUMBER]
}
n.a.
ipaperEvent_productAddedToCart
{
  Id: [PRODUCT_ID],
  Name: [PRODUCT_NAME],
  Page: [PAGE_NUMBER]
}
n.a.
ipaperEvent_newsTickerExternalLinkClick
{
  Url: [EXTERNAL_URL]
}
n.a.
ipaperEvent_search
{
  Term: [SEARCH_TERM]
}
n.a.
ipaperEvent_shopCheckout
{
  NumberOfProducts: [NO_OF_PRODUCT_IN_CART],
  CheckoutType: [CHECKOUT_TYPE],
  BasketValue: [TOTAL_BASKET_VALUE]
}
Possible CheckoutType values are Email, ShareEmail, Checkout, or Print.
ipaperEvent_videoPlay
{
  Url: [VIDEO_URL],
  VideoType: [VIDEO_TYPE],
  Page: [PAGE_NUMBER]
}
Only the first play is registered. Possible VideoType values are Video, YouTube, or Vimeo.

Example

An example of a DataLayer push for the event ipaperEvent_<wbr />externalLinkClick could look like this:

window.dataLayer.push({
	'event': 'ipaperEvent_<wbr />externalLinkClick',
	'ipaperEventParams': {
		HoverText: 'The clicked links hover text', 
		Url: 'http://ipaper.io/', 
		Page: 12
	},
	'ipaperEventCategory': 'iPaper events',
	'ipaperEventAction': 'External Link Click',
	'ipaperEventLabel': 'HoverText: The clicked links hover text | Url: http://ipaper.io/ | Page: 12'
})

Page element click tracking on GTM

Aside from the events listed above, we also track the PageElementClicked event, but it’s only triggered for the internal & external linktype.

Event name Data Comment
PageElementClicked
{
  Type: 'internal' | 'external',
  Data: {
    Url: String,
    Pagenumber: String
  }
}
Triggered on internal and external linktypes only

Event labels in GA and GTM

The data format below is represented in JSON. It is converted to a string for the eventLabel object using the following convention:

  • Key names are PascalCased
  • Key-value pairs are separated by the pipe character |

Example:

{
  HoverText: [LINK_HOVER_TEXT],
  Url: [EXTERNAL_URL],
  Page: [PAGE_NUMBER]
}

…is converted into:

HoverText: [LINK_HOVER_TEXT] | Url: [EXTERNAL_URL] | Page: [PAGE_NUMBER]