I'm trying to load a datalayer after using gform_after_submission

Kregg Kish
Mon, 13 Jul 2020 21:47:38 +0000
Get Help

Hello there!
I need to load a datalayer code after sending a successfully form
this is my code:

add_action('gform_after_submission_7', 'set_academy_title', 10, 2);

function set_academy_title($entry, $form)
{ ?>

		window.dataLayer = window.dataLayer || [];
		dataLayer.push({
			'event': 'academy-subscription',
			'academyTitle': '<?php the_title(); ?>'
		});

<?php }

everything is working good but this script is loading inside an iframe https://prnt.sc/th6hpl so i cant track the data
could you help me please?
thank you

3 posts - 3 participants