-
AuthorPosts
-
August 5, 2014 at 11:28 am #78254
I need to embed a javascript code snippet into the footer which doesn’t seem to be functioning properly. The code snippet is a call tracking tracking seen below:
<!– start number replacer –>
<script type=”text/javascript”><!–
var vs_account_id = “xxxxxx_xxx”;
//–></script>
<script type=”text/javascript” src=”http://website.com/number-changer.php”>
</script>
<!– end ad widget –>Can you let me know where, how to embed this code to function properly? Thanks!
August 5, 2014 at 3:15 pm #78456hi there,
please add this code below in your active child theme functions.php
function addfooter_script() { ?> <!– start number replacer –> <script type=”text/javascript”><!– var vs_account_id = “xxxxxx_xxx”; //–></script> <script type=”text/javascript” src=”http://website.com/number-changer.php”> </script> <!– end ad widget –> <?php } add_action('wp_footer','addfooter_script');
Cheers
August 18, 2014 at 2:50 pm #87070Hi and thanks for the response.
I tried adding it the the child theme and it’s still not working. Is there some other advice you can give me? Not being able to track our calls because of some weird javascript blocking is a significant issue.
August 18, 2014 at 3:02 pm #87084Hi There,
Can you please provide url of your site.
Did you make sure you’ve added the code to your current active child theme?
You can also provide login access to your site so we can check it.
Cheers
August 18, 2014 at 3:32 pm #87100This reply has been marked as private.August 18, 2014 at 3:39 pm #87104Hey Mark,
Have you tried embedding the code via Customize > Custom > Javascript. Just copy and paste your code in Javascript box and let us know how this goes!
August 18, 2014 at 5:03 pm #87157This reply has been marked as private.August 19, 2014 at 12:36 am #87336Hi Mark
The file on your javascript code returns a 404 – File or directory not found.
August 19, 2014 at 9:02 am #87619That’s not the real url, I was posting it to a forum that I couldn’t set to private (for that specific post) so I changed the URL and account id neither of which should matter since the code is accurately placed on the website.
August 19, 2014 at 9:57 am #87685Hi Mark,
I’m really confuse about your issue,
1. Can you please provide the exact javascript code you want to add on the footer?
I noticed this script
<script type="text/javascript" src="http://1196.xg4ken.com/media/number-changer/voicestar/number-changer.php"></script>
has been added 4 times on your page. and I’m not sure what did you do to have that added 4 times.2. I’ve seen the previous code working properly adding your script at the footer, can you tell us what really your issue?
You can see this code If you view the page source
<script type="text/javascript">var vs_account_id="CtjSaFKPUut_NACm";</script> <script type="text/javascript" src="http://1196.xg4ken.com/media/number-changer/voicestar/number-changer.php"></script>
August 19, 2014 at 10:44 am #87711This reply has been marked as private.August 19, 2014 at 11:33 am #87755Hi Mark,
I think you should first try adding the script one time only and not 4 times.
I can see this page http://mastermechanicauto.com/auto-air-conditioning/?_vsrefdom=p.640 has also 4 the script.
Also, you might want to try disabling your caching plugin and other plugin you installed not associated with X as I can see few errors in the console.
Additionally, I really don’t know how that script works and how it should suppose to change an element into something without even targeting that specific element. I can’t even think that would be possible unless you assign some class or some selector to your phone number that correspond to your script
Can you provide additional information on how that supposed to change something with only the script provided need to be added on the page for us to help and diagnose about this issue.
Thanks
August 21, 2014 at 3:39 pm #89568I removed all other places the code is placed and still, it’s not functioning the way it should be. I’ve used other themes that didn’t cause this type of conflict so I know it has to do with the theme itself. I disabled the plugin and that did not help either. This is essentially how it works – https://support.callrail.com/hc/en-us/articles/201051406-Installing-Dynamic-Number-Insertion
August 21, 2014 at 5:11 pm #89645This reply has been marked as private. -
AuthorPosts