enonic / app-google-analytics-old Goto Github PK
View Code? Open in Web Editor NEWApp for integration with Google Analytics
License: Apache License 2.0
App for integration with Google Analytics
License: Apache License 2.0
Users without admin rights get a 403 error on authenticate endpoint when opening the widget, but no error message outside of the browser console.
We want content editors to be able to view the analytics of their own content.
The UI for Google Analytics, and Google API, have both changed (again). Hardly any of the screenshots in the instruction text is longer valid, and even some new screens are needed, or changed a lot. Installation instructions should be revised: https://github.com/enonic/app-google-analytics/blob/master/docs/installing.md
The client side javascript is deprecated so we will have to setup another way to fetch the data from Google analytics.
Charts to create:
Site:
Pages
The new ga4 script is the same a google tag manager.
This will create a clashing between the tag manager app and the new script.
Also will not work with the old UA google analytics id.
This is really useful for ppl using this app with regards to GDPR:
https://developers.google.com/analytics/devguides/collection/analyticsjs/ip-anonymization
https://www.datatilsynet.no/personvern-pa-ulike-omrader/internett-og-apper/webanalyse/
Need a config to enable anonymize, and add a function to the snippet:
snippet += 'ga(\'set\', \'anonymizeIp\', true);';
We want to upgrade to the new GA analytics id. The current UA tag is not longer supported.
The processor needs to be updated with the new script.
Also handle if the app is intalled without a GA id inserted in the app settings.
The app wil temporarly support both the old and new tag. (The widget still relies on the old google analytics UA id)
The recommened way to access the new apis google are working on is by using Auth0.
See this client side setup: https://developers.google.com/identity/protocols/oauth2/javascript-implicit-flow
It seems we might be able to connect a service worker to handle the authentication step:
https://developers.google.com/identity/protocols/oauth2/service-account
This is all related the the new Google Analytics Data API v1 https://developers.google.com/analytics/devguides/reporting/data/v1
Google has changed the layout of their pages, so the documentation for this app is a bit "unhelpfull" at the moment.
I recommend going trough the setup again, taking new screenshots for the documentation.
In your filter, you're checking if the pageContributions.headEnd
is falsy.
pageContributions.headEnd
might be a string. A non-empty string would return truthy, which would make the filter crash, since you're calling .push
later on (a string doesn't have that method).
The recommended approach seems to be 0auth.
There is Java Classes for this that we can use to do the authentication.
We're using Google Tag Manager instead of Google Analytics. Could this app support that as well?
Even though app can be installed via market, the app cannot be setup to work as a widget without developer assistanse.
Could installation process be simplified? Move some settings inside app? Any other ways to solve this?
https://github.com/enonic/app-google-analytics/blob/master/docs/installing.md
New header settings could deny inline scripts.
Could we change the analytics app to not have any inline scripts?
The version of the google analytics used in this app is considred legacy. Google analytics 4 has breaking changes.
Can the app be upgraded to support the newest version?
Google analytics has a new api for getting analytics data.
Looks like there is a client side javascript that can query the new data api:
https://developers.google.com/analytics/devguides/reporting/core/v4/quickstart/web-js
Try out if its possible to use the client side library within the widget of the app
The app is now using three remote GA scripts: one to fetch GA API and two (one, two) to render the map. (The last two will only be used if ga.mapsApiKey
is set in the config. )
After implementation of CSP in Content Studio, these scripts will no longer work.
Replace client-side requests to these scripts with requests to local services which will in turn fetch data from the actual sources and return them to the client.
Also, since it's the validity of config which decides whether to append the scripts (and which scripts to append), we can make these scripts a part of the template and get rid of "dynamic appending" client-side. Then we don't need id
on the widget tag etc.
<widget>
<script data-th-if="${configValid}" data-th-src="${portal.serviceUrl({'_path=ga-script-1'})}"></script>
<script data-th-if="${useMapsApi}" data-th-src="${portal.serviceUrl({'_path=ga-script-2'})}"></script>
</widget>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.