Use Google Analytics 4 in CONTENTdm
Learn how to use Google Analytics 4 in CONTENTdm. For the older Universal Analytics, please see Use Google Analytics 4 in CONTENTdm.
CONTENTdm supports Google Analytics 4 (GA4), Google’s next-generation analytics tool. Support for the older Universal Analytics (UA) will run parallel with GA4 until its end-of-life date of July 2023.
Add Google Analytics 4 support to your site
Before the EOL date for UA, you can track your site’s activities with either or both Universal Analytics (UA) and GoogleAnalytics 4 (GA4). You can include Tracker IDs of one or both Google Analytics versions in your Website Configuration Tool.
First, create a property in your Google Analytics account.
- Refer to Add a Google Analytics 4 property if you already have UA.
- Refer to Set up Analytics for a website and/or app if you do not have UA.
Note the Tracking ID, referred to as the Measurement ID for GA4. The ID starts with the G-. This is not the property ID, but the tracking ID or measurement ID. Refer to Tracking ID support.
- Sign in to the CONTENTdm Website Configuration Tool.
- Navigate to Global Settings > Analytics & SEO > Google Analytics.
- If you are tracking your site activities in UA, the Google Analytics Tracker ID field should contain a Tracker ID starting with UA-:
- Example: UA-#########
- To track in both UA and GA4, add the GA4 Tracker ID, starting with G-, to the Google Analytics Tracker ID field with a comma to separate the two IDs and no space in between:
- Example: UA-#########,G-#########
- To only track in GA4, add a single GA4 Tracker ID to the Google Analytics Tracker ID field:
- Example: G-#########
- Click Save and Publish.
Per Google, it can take up to 30 minutes for data to begin appearing in your new GA4 property. Some reports can take 24-48 hours to appear.
About custom dimensions in GA4
Once you add GA4 tracking to your website, you can start to use the real-time data and some of the standard reports to view and analyze your data. Refer to Understanding Google Analytics Reports (GA4). You can also set up custom dimensions to track additional data CONTENTdm supports to collect more meaningful data specific to your CONTENTdm collections. Refer to Custom dimensions and metrics (GA4).
GA4 tracks:
- event_name
- event_parameters
For example, to understand how the Download function is used, only tracking how often the Download button is clicked is not as informative. Instead, knowing which items users are downloading will be much more meaningful. In GA4, the download clicking event has event parameters attached to it, such as collection_id, item_id, and download label, which will tell you more information about the downloads.
Set up these event parameters with the specific events to create custom dimensions. Afterward, use these custom dimensions to generate custom reports to help you visualize your analytics data.
In GA4, the event name is the top-level way of identifying events. In CONTENTdm, examples of these names are search and download item.
GA4 allows us to send additional event parameters along with events. These can vary based on the event name. View these event parameters in the Realtime view when you drill down into events. To be able to drill down into their values over the longer-term analysis views in Google Analytics, as well as to build custom reports based on them, it is necessary to add custom dimensions for each unique event parameter.
Once added, new events will have those parameters processed as custom dimensions, and those values will be usable in reports.
Event parameters
Below is a list of event parameters that CONTENTdm supports. Add the desired event parameters for tracking. The most important event parameters that we recommend customers add are collection_alias, item_id, and query. If compound objects are used, parent_id is also recommended.
Dimension name (you can specify your own name) |
Description |
Scope |
User Property/Parameter |
---|---|---|---|
Collection |
The collection ID of the item in question |
Event |
collection_alias |
Download_label |
The label of the download button when it is clicked |
Event |
download_label |
Item |
The item ID |
Event |
item_id |
Item type |
Whether an item is a single item or compound object |
Event |
item_type |
Item_url |
The URL of a URL stored as an item in CONTENTdm, which a user visits via CONTENTdm |
Event |
item_url |
Language |
The language a user selects for viewing CONTENTdm |
Event |
language |
Link |
A custom (customer-configured) link the user clicks in the header |
Event |
link |
Page |
Which page a user was on when they used the pagination controls |
Event |
page |
Query |
The user's search query |
Event |
query |
Size |
The size of an image being downloaded |
Event |
size |
Source |
The source of a link being clicked, either the footer or hamburger menu |
Event |
source |
Title |
The title of a PDF being expanded |
Event |
title |
Type |
The type of the event. Used for type of pagination control interacted with, and type of search performed. |
Event |
type |
Count |
A numerical value the user selected |
Event |
count |
Format |
The format of the data chosen by the user |
Event |
format |
Parent_id |
The ID of the parent object in use cases involving compound objects |
Event |
parent_id |
Parent_title |
The title of the parent object in use cases involving compound objects |
Event |
parent_title |
Note: Not all of these custom parameters are sent for all events. Each individual event may have zero or a few custom parameters sent with it.
Add Custom Dimensions
To add custom dimensions:
- Sign in to your GA4 property.
- Select Configure from the left pane, which expands when you mouse over it.
- From the Configure screen, click on Custom definitions.
- Click on the Create custom dimensions button.
- You will not initially have any custom dimensions, but once created, they will appear in the table under the Custom dimensions tab.
- Add the custom dimension.
- The Event parameter must match the parameters that OCLC is sending via CONTENTdm. Refer to the Event Parameter column in the above list of Event parameters table.
- The Scope must be Event (default).
- Dimension name is what it will appear as in your Google Analytics instance.
- Description is optional and for your reference only.
- Once you have added the custom dimension, it will show up in your list of Custom Dimensions.
- Repeat this process for all of the other CONTENTdm custom parameters.
Once you have added custom dimensions, events that GA4 receives that have the specified custom parameters will now have those processed as custom dimensions and will be available both in GA4 default reports (in the Reports section), as well as in custom reports you build in the Explore section of GA4.
Note: It takes 24-48 hours for the events with custom dimensions to start showing up in the Reports and Explore sections. This is a Google Analytics limitation.