November Happy Hour will be moved to Thursday December 5th.

Eric
Feb 4, 2015
  2730
(1 votes)

A reminder, things you also need when installing Google Analytics plugin for EPiServer and using ASP.Net MVC

There are probably some documentation regarding this on EPiServer World but I had some trouble finding the information needed. Installation of the Add-On for Google analytics is really easy but to make everything work we also need to put some code in your views, not only install the add-on

There are two ways of make Google Analytics track your visitors:

Update:

  • Use RequiredClientResources (Recommended)
   1:  @Html.RequiredClientResources(RenderingTags.Header)
   2:   
   3:  @Html.RequiredClientResources(RenderingTags.Footer) 
  • Or use AnalyticsTrackingScript helper if you are not using above already in your _Layout.cshtml
   1:  @Html.AnalyticsTrackingScript(Model.CurrentPage)

 

And that’s it.

Happy tracking

Feb 04, 2015

Comments

K Khan
K Khan Feb 4, 2015 02:31 PM

Remember glcid is case sensitive and Google Analytics can fail, if someone's website is converting urls into lower case including the values of glcid.
Regards
/K

Feb 4, 2015 09:23 PM

Eric, I use:
@Html.RequiredClientResources(EPiServer.Framework.Web.RenderingTags.Header)

And only that one (inside head). I guess you can use either areas.

@Html.AnalyticsTrackingScript(Model.CurrentPage) can be used if you do NOT use RequiredClientResources in your layout. But since it is recommended to have that (both for header and footer), it is rarely used.

/Steve

Eric
Eric Feb 4, 2015 10:25 PM

Awsome :) Thanks for the reply.

Johan Kronberg
Johan Kronberg Feb 6, 2015 11:29 AM

I recommend using Google Tag Manager for tracking. The plugin (at least the old one) just sets 2 custom vars that are very easy to replicate.

Eric
Eric Feb 6, 2015 10:24 PM

Thanks. I am not that much into analytics but customers do like the plugin and could not find any documentation how to render the actual script. I also noticed that people talk more and more about the Google Tack Manager.

Please login to comment.
Latest blogs
Optimizely SaaS CMS + Coveo Search Page

Short on time but need a listing feature with filters, pagination, and sorting? Create a fully functional Coveo-powered search page driven by data...

Damian Smutek | Nov 21, 2024 | Syndicated blog

Optimizely SaaS CMS DAM Picker (Interim)

Simplify your Optimizely SaaS CMS workflow with the Interim DAM Picker Chrome extension. Seamlessly integrate your DAM system, streamlining asset...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Optimizely CMS Roadmap

Explore Optimizely CMS's latest roadmap, packed with developer-focused updates. From SaaS speed to Visual Builder enhancements, developer tooling...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Set Default Culture in Optimizely CMS 12

Take control over culture-specific operations like date and time formatting.

Tomas Hensrud Gulla | Nov 15, 2024 | Syndicated blog

I'm running Optimizely CMS on .NET 9!

It works 🎉

Tomas Hensrud Gulla | Nov 12, 2024 | Syndicated blog

Recraft's image generation with AI-Assistant for Optimizely

Recraft V3 model is outperforming all other models in the image generation space and we are happy to share: Recraft's new model is now available fo...

Luc Gosso (MVP) | Nov 8, 2024 | Syndicated blog