
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@wizdm/gtag
Advanced tools
Google Tags (also known as Google Analytics) support for Angular.
Import the Gtag module in your root module calling the static init()
function to setup it up:
import { GtagModule } from '@wizdm/gtag';
@NgModule({
imports: [
...
GtagModule.init({
targetId: '<<YOUR GOOGLE ID HERE>>'
})
]
bootstrap: [AppComponent]
})
export class AppModule { }
The package provides a gtag
directive to be used ...:
...
<section fxLayout="column" fxLayoutAlign="center center" gtag="home">
<p><b>Google Site Tagging</b> (aka Google Analytics) Example</p>
</section>
...
The gtag="home"
statement in the .html sends a page-view event to the Google Analytics, Google Ads or Google Marketing Platform account you configured during the initialization.
The “home” text will appear in the report to be the page title while the page location is automatically detected by the directive provided the application makes use of a Router.
The package provides GtagService service implementing all the default Google Analytics events:
import { GtagService } from '@wizdm/gtag';
...
@Component(...)
export class MyComponent()
constructor(private gtag: GtagService) {
gtag.login('Google');
gtag.search('Bologna')
.then( () => console.log('Search correctly tagged') )
.catch( e => console.error(e) );
gtag.addToCart([{
id: "P12345",
name: "Android Warhol T-Shirt",
list_name: "Search Results",
brand: "Google",
category: "Apparel/T-Shirts",
variant: "Black",
list_position: 1,
quantity: 2,
price: '2.0'
}]);
}
...
}
...
The above example demostrates the way to send a login event (with ‘Google’ as its method) a search event (with ‘Bologna’ as a search term) and a complete add_to_cart e-commerce event.
These methods return a Promise, as the search() call made clear, so to perform asynchronous tasks right after the tagging completed.
In order to prevent the Promise from never resolving, in the eventuality the gtag.js
library would fail to load, the package implements a timeout function following Google’s recommendations.
The default timeout value is set to 10s and can be configured during initialization.
FAQs
Google Tags for Angular
We found that @wizdm/gtag demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.