
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
wlrp__conversion-tracker
Advanced tools
<script src="path/to/conversion.js"></script>
<script>
// Minimal setup
var config = {
id: 'GTM-123456'
},
reporter = new ConversionReporter(config);
</script>
This will inject the GTM script with the ID provided and initialize the Reporter object.
// Set manually
reporter.setAmount(10);
reporter.setQuantity(2);
// Or bind to an element that has a `value` property (i.e. input)
reporter.bindAmount(document.getElementById('amountInput'));
reporter.bindQuantity(document.getElementById('quantityInput'));
This will populate the amount
and quantity
fields of your Reporter object. Reports can now be sent using these values. Add a custom revenue calculator to the config if you want anything more complex.
reporter.sendReport();
To use a custom calculator for your revenue reporting, pass a function to the Reporter object's constructor that does the calculations. The function must have 2 params (quantity and amount), and must return an integer.
function calculateCustom(quantity, amount) {
// Only 20% commission from partner sales?
return (quantity*amount)*0.2;
}
var config = {
id: 'GTM-123456'
calculator: calculateCustom
},
reporter = new ConversionReporter(config);
function(quantity, amount) {
return quantity * amount;
}
FAQs
WLRP Conversion tracking library based on Google Tag Manager
We found that wlrp__conversion-tracker 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.