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...Skins, Themes, ...Skins, Themes, ...javascript code at the top of my websitejavascript code at the top of my website
Previous
 
Next
New Post
11/16/2014 1:42 AM
 

hey guys,

I'm working with a new client, www.publikaya.com and right after I inserted the google analytics code I had some javascript code at the top of all the website pages. I think the problem was before Google analytics but I'm not sure when. 

I already tried with a new install and I got the same output.

One thing that is weird is that whenever I go the skins section, it won't let me apply the skin I purchased, it refresh back to Gravity.

The code is available when you see it at the URL www.publikaya.com but here it is as well,

(function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();

Thanks,

 
New Post
11/16/2014 2:31 PM
 
I've tried to update the skin to the latest 7.3.4 but I get the same. I also tried several skins and the same problem. Any ideas? Please make sure to check my website to see the problem www.publikaya.com, the code appears at the top of the skin.
 
New Post
11/16/2014 2:48 PM
Accepted Answer 
I figured this out, I manually went into the google analytics config file and manually insert the code in there and save the file. Afterwards, everything went back to normal and it's working fine.
 
New Post
11/20/2014 4:18 PM
 

By doing that you run the risk of having that overwritten if you perform an upgrade. Also if this is for the google tag manager, your script may not be in the right spot. 

I got around this by creating a skin object that I placed in my skins that injects the tag manager code in the right spot. I can't remember where I originally found the code, but it could have been switzerland.

...

In the skinobject ascx

<%@ Control Language="C#" AutoEventWireup="false" %>

<script runat="server">

     protected override void OnInit(EventArgs e)

     {

         base.OnInit(e);

         var tp = (CDefault)Page;

         tp.FindControl("Body").Controls.AddAt(0, new Literal() { Text = "<!-- Google Tag Manager --><noscript><iframe src='//www.googletagmanager.com/ns.html?id=TRACKING-ID'height='0' width='0' style='display:none;visibility:hidden'></iframe></noscript><script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'scr" + "ipt','dataLayer','TRACKING-ID');</scr" + "ipt><!-- End Google Tag Manager -->" });

           

     }

 </script>

 
New Post
11/20/2014 5:24 PM
 
erik hinds wrote:

By doing that you run the risk of having that overwritten if you perform an upgrade. Also if this is for the google tag manager, your script may not be in the right spot. 

I got around this by creating a skin object that I placed in my skins that injects the tag manager code in the right spot. I can't remember where I originally found the code, but it could have been switzerland.

...

In the skinobject ascx

<%@ Control Language="C#" AutoEventWireup="false" %>

 If you edit tyhge google analytics config file in the portal folder it will not be overwritten on upgrade.

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...javascript code at the top of my websitejavascript code at the top of my website


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