Allow Google Analytics in Primo VE
We would like to add GA to our new Primo VE instance, but received this message from support:
"I have checked with our support team and also with documentation this is not possible. There is currently no supported way to embed Google Analytics code in Primo VE."
We would really like to see this functionality added. We have a Primo search box on our homepage, and most users do search directly from our homepage. Without GA in Primo, our homepage shows a very high bounce rate and we're unable to determine if that's because users are actually leaving or if they're just using the search box and being bounced away from our homepage when searching.

We'd like to clarify that Google Analytics can be embedded into Primo VE using the customization package. We have seen examples from customers implementing it and posting on GitHub how this can be achieve.
we had another idea in the past which also refers to that https://ideas.exlibrisgroup.com/forums/308176-primo/suggestions/33173506-allow-google-analytics-integration-for-the-new-pri and since Primo / Primo VE using same customization capabilities , it is supported.
-
Toby Teng commented
I agree with Ian, it would be great if Google Analytics integration is supported within Primo VE configuration.
-
Ian Chan commented
I think the goal with this request is to have Google Analytics integrated within Primo VE, without the need for customization. As an example, Leganto offers GA integration without the need for customization (screenshot attached for those without Leganto).
This is a feature that would be very widely used and Ex Libris should build it into the application. While we have developed a complex customization that tracks more of the page actions in Primo VE, we should not have to continue to maintain our customization when Ex Libris can make it part of their application (and more than likely do so with less resource investment than us).
-
Manu Schwendener commented
Dear Nili
> examples from customers implementing it and posting on GitHub how this can be achieved
Could you share a link to github?
---
Via the Primo mailing list; I have not tested this:
"I am not a programmer, and I am sure there is a more elegant way to achieve this, but I was able to get Google Analytics working. In the custom.js file, add the following code. Be sure to replace 'G-XXXXXXXXXX' with your Analytics tag ID:
//START - Google Analytics
var googleAnalyticsUrl = document.createElement('script');
googleAnalyticsUrl.src = "https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX";
googleAnalyticsUrl.type = 'text/javascript';
googleAnalyticsUrl.async = true;
document.head.appendChild(googleAnalyticsUrl);var googleAnalyticsCode = document.createElement('script');
googleAnalyticsCode.innerHTML = `window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');`;
document.head.appendChild(googleAnalyticsCode);//END - Google Analytics
Ken Wierzbowski
" -
Stan commented
I would love to see this. For now, our plan is to inject the analytics code in the HEAD using angular injection (and/or JQuery) and then fire events as needed using the Primo router.