
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@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.
The npm package @onehilltech/ember-cli-google-analytics receives a total of 0 weekly downloads. As such, @onehilltech/ember-cli-google-analytics popularity was classified as not popular.
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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.