Last active
November 29, 2017 19:12
-
-
Save steveosoule/98d7c9b4bf60be57b9dd352fd0ff8d6c to your computer and use it in GitHub Desktop.
Ad-Blocked MVGA.js Overrides for when GA is not loaded
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
If Google Analytics does not load (add-blocking, network issues, etc.), | |
Then we need to disable the MVGA tracking functions and let the forms/links submit normally. | |
*/ | |
$(window).on('load', function add_ga_failsafes(){ | |
if( typeof ga !== 'undefined' && typeof ga.create !== 'undefined' ){ | |
return; | |
} | |
MVGA_Tracker.prototype.List_AddToBasketSubmit = function(e){}; | |
MVGA_Tracker.prototype.RemoveFromBasketForms = function(e){}; | |
MVGA_Tracker.prototype.UpdateBasketQuantity = function(e){}; | |
MVGA_Tracker.prototype.UpsellOUS1FormSubmit = function(e){}; | |
MVGA_Tracker.prototype.UpsellFormSubmit = function(e){}; | |
MVGA_Tracker.prototype.OSELFormSubmit = function(e){}; | |
MVGA_Tracker.prototype.AddToBasketSubmit = function(e){}; | |
MVGA_Tracker.prototype.ProductLinkClick = function(e){}; | |
MVGA_Tracker.prototype.RemoveFromBasketLinks = function(e){}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment