Nutrition Facts
Serving Size: 1
Item / Ingredient Name
Amount Per Serving
Calories 0
% Daily Value*
Total Fat 0 grams 0% Daily Value
Saturated Fat 0 grams 0% Daily Value
Trans Fat 0 grams
Cholesterol 0 milligrams 0% Daily Value
Sodium 0 milligrams 0% Daily Value
Total Carbohydrates 0 grams 0% Daily Value
Dietary Fiber 0 grams 0% Daily Value
Sugars 0 grams
Includes 0 grams Added Sugars 0% Daily Value
Protein 0 grams
Vitamin D 0 micrograms 0%
Calcium 0 milligrams 0%
Iron 0 milligrams 0%
Potassium 0 milligrams 0%
Caffeine 0mg
The % Daily Value (DV) tells you how much a nutrient in a serving of food contributes to a daily diet. 2000 calories a day is used for general nutrition advice.
INGREDIENTS: None
Data not available

Example #1

Basic use of the using the google analytics event feature supplying a renamed google analytics function The code for the google analytics is:

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','_gaNixLabel');

_gaNixLabel('create', 'UA-12345678-9', 'auto');


$('#test1').nutritionLabel({
	showLegacyVersion : false,
	allowGoogleAnalyticsEventLog : true,
	gooleAnalyticsFunctionName : '_gaNixLabel'
});


Nutrition Facts
Serving Size: 1
Item / Ingredient Name
Amount Per Serving
Calories 0
% Daily Value*
Total Fat 0 grams 0% Daily Value
Saturated Fat 0 grams 0% Daily Value
Trans Fat 0 grams
Cholesterol 0 milligrams 0% Daily Value
Sodium 0 milligrams 0% Daily Value
Total Carbohydrates 0 grams 0% Daily Value
Dietary Fiber 0 grams 0% Daily Value
Sugars 0 grams
Includes 0 grams Added Sugars 0% Daily Value
Protein 0 grams
Vitamin D 0 micrograms 0%
Calcium 0 milligrams 0%
Iron 0 milligrams 0%
Potassium 0 milligrams 0%
Caffeine 0mg
The % Daily Value (DV) tells you how much a nutrient in a serving of food contributes to a daily diet. 2000 calories a day is used for general nutrition advice.
INGREDIENTS: None
Data not available

Example #2

This is an example where the user function "alertMe" is triggered when the quantity value is changed. The plugin calls the function "alertMe" with 3 parameters 1. kind - textbox / up arrow / down arrow 2. previous value 3. new value The code of "alertMe" is:

function alertMe(kindValue, OldValue, NewValue){
	console.log(
		'kindValue => ' + kindValue + "\n" +
		'OldValue => ' + OldValue + "\n" +
		'NewValue => ' + NewValue
	);
}


$('#test2').nutritionLabel({
	allowTriggerOfUserFunctionOnQuantityChange : true,
	userFunctionNameOnQuantityChange : 'alertMe',
	showLegacyVersion : false
});