Comments (3)
Hi,
You can add any analytics module to the angular side. For example: https://github.com/angulartics/angulartics2
There you can handle pretty much any event you want.
Don't know if its possible to add it on the chrome side, besides that, don't think you need it there either?
Good luck 👍
from ng-chrome-extension.
Oh, thx for the link, will take a look.
I have successfully added the GA to the chrome side so far. It has been a matter of:
- Adding a separate javascript file with a snippet (it is important since Chrome runtime does not allow to execute inline scripts without some mambo-jumbo policies, so you better place your javascript snippet to the
analytics.js
than make it a part of theindex.html
); - Importing this file to the background page (moreover, a content script should send a chrome.runtime message to the background page if there is a need to track something).
The reason I'd like to track the chrome side of the extensions is because of some events and metrics in my content scripts. So the angular side is more about interacting with UI (e.g. popup, options), and the chrome side is helpful to catch hotkeys, runtime.messages, e.t.c.
References:
- https://stackoverflow.com/questions/11372107/content-script-tracking-with-google-analytics/31654055#31654055
- https://developers.google.com/analytics/devguides/collection/analyticsjs/tracking-snippet-reference
from ng-chrome-extension.
All right, glad that it worked out :-)
from ng-chrome-extension.
Related Issues (20)
- Some thing doesn't work with Angular Material HOT 1
- Error: authentication required but no callback set HOT 7
- CSP error after upgrading from Angular 11 to 12 HOT 2
- npm install does not work on a mac HOT 3
- Project ignores Angular changes (watch not working) HOT 1
- Question: sharing common classes between layers HOT 1
- Access window.ethereum properties HOT 1
- Import primeng HOT 1
- I always get an error when I create a project with a "-" in the project name HOT 6
- Is there a wiki on how to update ng-chrome built extensions from manifest v2 to manifest v3 HOT 1
- Chnage Manifest file data based on environment/or with custom variables HOT 1
- Unable to add css urls and fonts in angular.json HOT 3
- getting data from the chrome storage doesn't trigger change detection HOT 2
- Using the extension as addition to existing web page HOT 1
- Problem with npm i HOT 1
- npm start not running on any port HOT 1
- JQuery plugin not working HOT 1
- Build scripts -> "ng build --configuration='development'" HOT 4
- load angular as content script
- how to load script like jquery.min.js into serviceWorker.ts HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng-chrome-extension.