NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Thys on September 14, 2011, 12:33:07 AM
-
Hi,
I need to add script in the <head> tag for Googly Analytics. I use the standard PageHeaderTag and though it could be placed in its XHTML section. But the <head> tag doesn't seem to be generated there. Where can I add the script so that it is placed in the <head> tag?
Thys
-
Ok - I figured it out. This script for Google Analytics can be added to the NetTalk extension template on the WebServer procedure under the Scripts tab. This is then listed as part of the standard scripts NT uses.
-
Hi,
I added the google.js in the webserver procedure and it does show on the site. Copied the file to the script folder. It has been over 2 days. However, Google account is not showing any activity. I understand the live option should show current visitors. It doesn't.
Any ideas?
Regards
Bijan
-
what is your site URL?
Do you need to add more things to the page, other than just the link to google.js to make the analytics work?
-
Hi Bruce,
https://americanairporter.net/
-
>> Do you need to add more things to the page, other than just the link to google.js to make the analytics work?
-
No Bruce,
This js works just fine on the main site. www.americanairporter.com
<!-- Google Analytics tracking code-->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-29134004-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
-
Since the analytics accounts are linked to a domain and you have two domains I don't think it'll work to just use the account number for the .com domain.
-
Hi Larry,
Thanks, this may help. There is an option for multiple top level domains when generating the tracking code. In addition, verification may be required for the tracking to be active. I have done both. It's recommended to wait 24 hours for all this to become active. Will let you know.
-
Bijan,
I haven't tried to configure an analytics account for multiple TLDs so it'd be great if you can post what you find out. We do have our customers complete the verification process for analytics too. Thanks.
-
Larry,
The js will be a little different if you choose TLD. There is even a check box for dynamic pages.
I created a separate index.html in the web folder and added the js there. It works on one domain with multiple subdomains or Multiple top-level domains.
However, when the JS is included in the header section of my webserver app, GA will not track my pages. I have frames for this webserver app and no index.html. I will try with a NT example app and will post the result. It will be next week.