
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@onehilltech/ember-cli-google-analytics
Advanced tools
EmberJS add-on for Google Analytics
ember install @onehilltech/ember-cli-google-analytics
After you install this add-on, you only need to add your Google analytics settings
to the config/environment.js file for basic usage.
// config/environment.js
let ENV = {
'ember-cli-google': {
analytics: {
version: 'v4',
measurementId: 'G-XXXXXXXXXX'
}
}
}
Ember 5.x deprecated implicit injections from its initializers. This means you have
to manually initialize Google Analytics in your application. The easiest way to initialize
the add-on is to inject the gtag service in the ApplicationRoute, and override the
activate() method to call gtag.configure() as shown below.
Use the following command to generate the application route:
ember g route application
import Route from '@ember/routing/route';
import { service } from '@ember/service';
export default class ApplicationRoute extends Route {
@service
gtag;
async activate () {
// Pass control to the base class.
await super.activate (...arguments);
// Configure Google Analytics for our application.
await this.gtag.configure ();
}
}
You can easily send custom events to Google Analytics by injecting the gtag service, and
calling the event(name, params) method. Here is an example of tracking the search term from an input
field.
import Component from '@glimmer/component';
import { action } from '@ember/object';
import { inject as service } from '@ember/service';
class SearchComponent extends Component {
// Inject the Google Tag Manager service into our component.
@service
gtag;
@action
searching (ev) {
const { target } = ev;
// Send an event to Google Analytics.
this.gtag.event ('searching', { term: target.value } );
}
}
Happy Coding!
FAQs
The default blueprint for ember-cli addons.
We found that @onehilltech/ember-cli-google-analytics demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.