Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Adding javascript to the <head> section DNN6Adding javascript to the <head> section DNN6
Previous
 
Next
New Post
9/7/2012 11:49 AM
 

Hello Forum
 
I need to add two javascript scripts to the <head> section of the home page of my dnn 6.1.4 installation.
 
Script 1 is a Moblie Redirect script the redirects visitors to the mobile version of my site.
 
<script src="http://static.dudamobile.com/DM_redir..." type="text/javascript"></script>
 
<script type="text/javascript">DM_redirect(" http://m.mydomain.com");</script>

What this script does is detect whether a user is using a mobile phone and then it redirects the user to the mobile version of the site.
 
Note: m.mydomain is a placeholder for my domain.
 
Script 2 is a google analytics script that I need to show on all the pages of my site.
 
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', XX-XXXXXXXX-X']); 
  _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>

Note: XX-XXXXXXXX-X is  placeholder for my google analytics account. This code should be placed before the end of the </head> section tag according to Google. This code should run on all pages of my site.

Where do I make these changes in DNN 6.1.4. Please give specific instructions if a need to edit any skin files or .ascx files or .aspx any code behind files

Thanks

All feedback will be appreciated

 

 

 
New Post
9/7/2012 11:56 AM
 
Admin --> Page management --> left-click page until it loads in the right-side pane --> Meta Tags section --> Page header tags --> paste your script links.

Or you can add them to your skin files if you want it on every page.

Mark
 
New Post
9/7/2012 8:20 PM
 

Thanks Mark,

I was successful in getting the script in the header section.

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Adding javascript to the <head> section DNN6Adding javascript to the <head> section DNN6


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out