MP_Addon_GA_Enqueue::lead_form_abandonment()

Adds the code to initialize form_abandonment_tracker function to the <footer> section for Lead Form.

Contents


Source Source

File: calculator-ga-add-on/inc/MP_Addon_GA_Enqueue.php

	public function lead_form_abandonment() {
		echo "<script type='text/javascript'>\n";
		echo "\t(function(){\n";
		echo "\t\tif (!window.gtag) {\n";
		echo "\t\t\tconsole.error(\"Lead Form Abandonment Tracking Error: Please pass in your gtag object when use Lead Form Abandonment Tracking.\");\n";
		echo "\t\t\treturn;\n";
		echo "\t\t}\n";
		echo "\t\tLeadFormAbandonmentTracker.init(gtag, 'mortgageleadForm', 'Mortgage Lead Form', 'LeadFormAbandonment');\n";
		echo "\t})();\n";
		echo "</script>\n";
	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.