Welcome to TalkGraphics.com
Results 1 to 8 of 8

Thread: Tracker code

  1. #1
    Join Date
    Jun 2009
    Posts
    14

    Default Tracker code

    Google Analytics states that it's code needs to be in the Head, not Body:

    Copy the following code, then paste it onto every page you want to track immediately before the closing </head> tag

    But it looks like there is no option in the Page or Site set up allowing you to put it anywhere but the body, which is where WD puts it. Has this issue been discussed somewhere, or is there an easy fix?

    Google Analytics page

  2. #2

    Default Re: Tracker code

    Create a placeholder object.
    Add your GA code to the 'Replace with HTML code' area of Web Properties >>Placeholder.
    Apply
    Right-click the placeholder object and choose 'Names'
    In the dialogue that appears type: <head> then add.

    That's it

  3. #3
    Join Date
    Jun 2009
    Posts
    14

    Default Re: Tracker code

    Thanks! I wonder if Xara knows about this. I actually missed the "head" requirement for a week and got some minimal results. Google doesn't automatically check it for you. But since WD puts this major Google tool in the body by default, I'll bet there are a lot of other novices that are wondering why they get few viewers.

  4. #4
    Join Date
    Jan 2004
    Posts
    1,830

    Default Re: Tracker code

    Google used to require the code to be inserted prior to the closing body tag and not within the head section of a web page.

    First there was urchin.js. Then came ga.js. Both of these tracking methods required you to insert the code prior to the closing body tag.

    Now there's a third version: asynchronous tracking code and the asynchronous tracking code needs to be added to the head section of the web page.

    Following the instructions provided by Sledger will allow you to achieve this.

    I expect the way the tracker code field works will be revisited within future versions of Web Designer.

  5. #5
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,528

    Default Re: Tracker code

    Quote Originally Posted by bb2 View Post
    I expect the way the tracker code field works will be revisited within future versions of Web Designer.
    By then Google will have changed the location of the code to the middle of the body section.

  6. #6
    Join Date
    Jun 2009
    Posts
    14

    Thumbs up Re: Tracker code

    The placeholder system seems to work. What's really nice is that I was able to use "Repeating Objects" for the placeholder and the code was placed throughout the site! This fix strikes me as so important that Xara should at least post it.

  7. #7
    Join Date
    Jun 2009
    Posts
    14

    Question Re: Tracker code

    Just when I thought I had this figured out, I come across new questions:

    Here Google says to add it at the end of the body, saying that "there are two basic ways to set up tracking on your web property: standard setup and customized setup."

    Then on another page it says to put it in the head.

    Somewhere else it said that if you had two tracking codes in different locations of the page, it may not work right!

  8. #8

    Default Re: Tracker code

    If I'm reading the google instructions correctly it looks like placing it in the head maximizes chances for the "tracking beacon" to be sent:

    "One of the main advantages of the asynchronous snippet is that you can position it at the top of the HTML document. This increases the likelihood that the tracking beacon will be sent before the user leaves the page."

    Not sure how much of an issue this is in real life except for cases where someone makes a quick hit on a page and moves on.

    So, I'm assuming the code still works even though it is in the body.

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •