
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
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.
Simply embed Google Tag Manager container snippet into Rails application.
Add these lines to your application's Gemfile:
gem 'gtm_rails'
And then execute:
$ bundle
Or install it yourself as:
$ gem install gtm_rails
Create config/google_tag_manager.yml
in your Rails application.
staging:
foo: GTM-YourGtmId1
bar: GTM-YourGtmId2
baz: GTM-YourGtmId3
production:
foo: GTM-YourGtmId4
bar: GTM-YourGtmId5
baz: GTM-YourGtmId6
The above is a sample. foo
, bar
, baz
are arbitrary label names, and replacing GTM-XXXX with your container ID.
In view, use two helper methods. (Click here to read more)
First, following method as close to the opening <head>
tag as possible on every page of your website.
<%= google_tag_manager_script_tag(:foo) %>
Second, following method immediately after the opening <body>
tag on every page of your website.
<%= google_tag_manager_noscript_tag(:foo) %>
These method arguments are a label name specified in config/google_tag_manager.yml
.
Google Tag Manager container snippet will be expanded based on Rails.env
and label name. If there is no match, a blank string is returned.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)gtm_rails is released under the MIT License.
FAQs
Unknown package
We found that gtm_rails 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
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.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.