Google Analytics - embed script in pagewrapper, or add to site config?

Options

Is there a right way to do this? We currently have the script embedded in our pagewrappers (Pagebuilder), but I'm wanting to flesh out our Google Analytics and get it truly integrated with our site. Are there any drawbacks to using the site config option to entre our tracking code versus embedding the script in the pagewrappers themselves? Seems like upkeep would be a lot simpler using the site config, and you would ensure nothing fell through the cracks.

Tagged:

Comments

  • Instead of embedding the script into the HTML editable area of the PageWrapper, you can simply drop it into the "Additional HTML Tags for HEAD Elements" area at the bottom of the Meta Tags page. (This is step 2 in the Process Navigator at the top left of the Page Wrapper editor.) It should look something like this (this example includes a conditional that checks if it's a secure page):

    ]::secure2::

    <script src="" type="text/javascript">

    </script>

    <!-- Google Tracking Code -->

    <script type="text/javascript">

    _uacct = "UA-*YOUR NUMBER*";

    urchinTracker();

    </script>

    ::

    <script src="" type="text/javascript">

    </script>

    <!-- Google Tracking Code -->

    <script type="text/javascript">

    _uacct = "UA-YOUR NUMBER";

    urchinTracker();

    </script>

    ]]

    I hope that helps!

    Jon

    (P.S. That bit at the top ] that is getting eaten by the editor should be ((S8)) --- where the (( are actually the square brackets.)

  • I would recommend using the site configuration options. This lets you more easily take advantages of enhancements that we make to the integration like the funnel tracking URLs and the eCommerce integration. It will also simplify moving from the urchin tracking code to the GA tracking code (which is currently a work in progress).

  • DavidHart :

    I would recommend using the site configuration options. This lets you more easily take advantages of enhancements that we make to the integration like the funnel tracking URLs and the eCommerce integration. It will also simplify moving from the urchin tracking code to the GA tracking code (which is currently a work in progress).

    I think I would add it in the footer of your page if you have a typical

    TOP NAV

    MAIN

    FOOTER

    format, as Google Analytics usually wants the Urchin code to be the last bit of information on your page.

    If you add it in the additional meta tags in your page wrapper, it will always load before the opening <body> tag.

  • I tried posting this question before, but didn't get a reply so I'll try again... is anyone else having problems with their goals and ecommerce conversions not being attributed to a referral. In other words, if someone comes to our website from an AdWords ad (or any website), and they make a donation, it doesn't attribute the donation with that source. It shows the source as always being our website or "direct/none"

    I read somewhere that since the traffic from our website is being sent to another domain (https://secure2.convio.net) the referral gets lost. They say the solution is to add some extra code to the analytics script and tag all your outgoing links, but I don't see other Convio users doing this.

    So is this just me or does this affect everyone?

  • Nathan Allen:

    I tried posting this question before, but didn't get a reply so I'll try again... is anyone else having problems with their goals and ecommerce conversions not being attributed to a referral. In other words, if someone comes to our website from an AdWords ad (or any website), and they make a donation, it doesn't attribute the donation with that source. It shows the source as always being our website or "direct/none"

    I read somewhere that since the traffic from our website is being sent to another domain (https://secure2.convio.net) the referral gets lost. They say the solution is to add some extra code to the analytics script and tag all your outgoing links, but I don't see other Convio users doing this.

    So is this just me or does this affect everyone?

    I've read the same thing as you, Nate. Frankly, I haven't gone to the effort to get our goals/conversions to work seamlessly, due to this cross domain referral issue.

    I'm fairly sure this affects everyone, though a Convio rep would need to confirm that.

    I do believe I have made Conversions work by parsing the URL of the Thank You/Confirmation page afer a donation to our website with Regular Expressions in Google Analytics. I think.

    I'd be happy to share what I did if it would help.

  • c.stauffer :

    I've read the same thing as you, Nate. Frankly, I haven't gone to the effort to get our goals/conversions to work seamlessly, due to this cross domain referral issue.

    I'm fairly sure this affects everyone, though a Convio rep would need to confirm that.

    I do believe I have made Conversions work by parsing the URL of the Thank You/Confirmation page afer a donation to our website with Regular Expressions in Google Analytics. I think.

    I'd be happy to share what I did if it would help.

    I sent you an email. Thanks!

  • So, then what is the best way? I at first figured the Additional Meta field in the Wrapper was the best place, although I know GA wants it at the end of the code. But then there is the argument for site config, to which I am not entirely familiar with what is meant by site config.

    If I went with addin it at the end of the code, would I just paste in the GA code at the bottom of the source code for the particular Wrapper?

  • jdp :

    So, then what is the best way? I at first figured the Additional Meta field in the Wrapper was the best place, although I know GA wants it at the end of the code. But then there is the argument for site config, to which I am not entirely familiar with what is meant by site config.

    If I went with addin it at the end of the code, would I just paste in the GA code at the bottom of the source code for the particular Wrapper?

    I have just enabled Google Analytics by adjusting these parameters in Setup / Site Options:

    GOOGLE_ANALYTICS_ACCOUNT:

    Entered out acct #

    GOOGLE_ANALYTICS_ENABLED:

    Set to TRUE

    GOOGLE_ANALYTICS_FUNNEL_DIRECTORY:

    Used default directory: funnel

    GOOGLE_ANALYTICS_FUNNEL_ENABLED:

    Set to TRUE

    GOOGLE_ANALYTICS_USE_LEGACY_CODE:

    Set to FALSE to use newer version of Google Analytics code

    Is this sufficient to get Google Analytics operational on all of our Convio pages?

Categories