Hi.
I was asked to add a PPC ad tracking script to my site’s header:
Can you please show me where I should add it in the header file. I’m using Enfold and have the child theme installed.
Thanks!
Hey mattb1169,
Please try this in your child theme’s functions.php file:
function add_custom_script_header(){ ?>
<script async src=”//90117.tctm.co/t.js”></script>
<?php
}
add_action('wp_head', 'add_custom_script_header');
Regards,
Rikard
That broke the site!
Help! I need to get this fixed ASAP
Parse error: syntax error, unexpected ‘?’ in /home/content/p3pnexwpnas07_data01/48/2475548/html/wp-content/themes/enfold-child/functions.php on line 8
Please advise!
I’ve restored a back up of the site, all good. Still would like to add that dynamic ad tracking script? Any suggestions as to where to put that?
Hi!
Please copy the code from the forum message and not the email
function add_custom_script_header(){ ?>
<script async src="//90117.tctm.co/t.js"></script>
<?php
}
add_action('wp_head', 'add_custom_script_header');
I have changed it.
Do and let us know if we can do anything else for you
Cheers!
Basilis
Thanks Basilis, will give it a shot tonight.
-M
Thanks Rikard,
Everything installed and no issues with the site. Our SEO guy is confirming script is working today.
Best,
M