
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.
Bacchanalytics is a rack middleware that inserts the Asynchronous Google Analytics Tracking Code in your application.
gem install bacchanalytics
Add the following line in your config/environment.rb:
config.middleware.use "Bacchanalytics::Analytics", :web_property_id => "UA-XXXXX-X"
You have to replace "UA-XXXXX-X" with the Google Analytics property ID of your site. You can find more information on the Google Analytics property ID in http://code.google.com/apis/analytics/docs/concepts/gaConceptsAccounts.html#accountID
You are able to set the domain name of your site.
config.middleware.use "Bacchanalytics::Analytics", :web_property_id => "UA-XXXXX-X"
:domain_name => ".facturagem.com"
You can also use "ignored organic" features in your pages with:
config.middleware.use "Bacchanalytics::Analytics", :web_property_id => "UA-XXXXXXX-X",
:ignored_organic => ["yoursite",
"yoursite.com",
"www.yoursite.com",
"http://www.yoursite.com",
"http://yoursite.com"]
In order to use A/B tests, just add the following lines to your config/environment.rb:
config.middleware.use "Bacchanalytics::WebsiteOptimizer", :account_id => 'UA-XXXXXXXX-X',
:ab => { 'NNNNNNNNNN' => {:a => ["/", "/public/index"],
:b => "/home2",
:goal => "/public/signup"}
}
where 'UA-XXXXXXXX-X' is the ID of the Website Optimizer account and 'NNNNNNNNNN' is the track page id, a key provided in the Website Optimizer javascript. The 'ab' hash contains the A (origin) pages, the B (variations) pages and the goal pages.
The embeded javascript looks like:
<!-- Google Website Optimizer Tracking Script -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['gwo._setAccount', 'UA-XXXXXXXX-X']);
_gaq.push(['gwo._trackPageview', '/3203696384/test']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<!-- End of Google Website Optimizer Tracking Script -->
As you can see, the 'NNNNNNNNNN' is the '3203696384' track page ID.
config.middleware.use "Bacchanalytics::AdwordsConversion", [
{:id => 'NNNNNNNNNN',
:label => 'oIiDCJe__QEQqcrF-gM',
:language => 'es',
:format => 3,
:value => 3.5,
:description => '',
:pages=>[ "/welcome", "/en/welcome", "/es/welcome", "/ca/welcome", "/eu/welcome"]
}
]
Copyright (c) 2011 ASPgems, released under the MIT license
FAQs
Unknown package
We found that bacchanalytics demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
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.