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)
{ ?>
<script type="text/javascript">
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'academy-subscription',
'academyTitle': '<?php the_title(); ?>'
});
</script>
<?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