Coded something up in Couch in an interesting way? Have a snippet or shortcode to share? Post it here for the community to benefit.
3 posts Page 1 of 1
Below is code that can easily be inserted in to the CMS to five you user the option to quickly and easily add their Google Analytics Code:

Code: Select all
      <cms:editable name='analyticsAndTracking' label='Analaytics and Tracking' type='group' /> 
         <cms:editable name='google_webamster_verification_code' label='Google Webmaster Verification Code' type='text'  group='analyticsAndTracking' ></cms:editable>
         <cms:editable name='ms_webamster_verification_code' label='Microsoft/Bing Webmaster Verification Code' type='text'  group='analyticsAndTracking' ></cms:editable>   
         <cms:editable name='googleAnalyticsCode' label='Google Analytics Code' type='text'  group='analyticsAndTracking' ></cms:editable>   
         <cms:editable name='googleAnalyticsDomain' label='Google Analytics Cookie Domain Name' type='text'  group='analyticsAndTracking' ></cms:editable>   
         <cms:editable name='googleAnalyticsCookieName' label='Google Analytics Cookie Website Name' type='text'  group='analyticsAndTracking' ></cms:editable>   
         <cms:editable name='googleAnalyticsCookieExpire' label='Google Analytics Cookie Expire Time' type='text'  group='analyticsAndTracking' >3600</cms:editable>

Below is the Google Analytics Code to be inserted into the body just under <body> tag:

Code: Select all
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  ga('create', "<cms:get_custom_field 'googleAnalyticsCode' masterpage='globals.php' />", {
    'cookieDomain': "<cms:get_custom_field 'googleAnalyticsDomain' masterpage='globals.php' />",
    'cookieName': "<cms:get_custom_field 'googleAnalyticsCookieName' masterpage='globals.php' />",
    'cookieExpires': <cms:get_custom_field 'googleAnalyticsCookieExpire' masterpage='globals.php' />
  ga('require', 'displayfeatures');
  ga('send', 'pageview');

Below is the code to be inserted in between he <head></head> tags to for Google Websmaster Verification andBing Webmaster Verification:

Code: Select all
    <meta name="google-site-verification" content="<cms:get_custom_field 'google_webamster_verification_code' masterpage='globals.php' />" />    
    <meta name="msvalidate.01" content="<cms:get_custom_field 'ms_webamster_verification_code' masterpage='globals.php' />" />   

I hope everyone finds this useful. :p

- Developernator
Hello @developernator,

How to find the values for all the editable regions that you have used?

where innovation meets technology
Hi there! :)

Here is a link how to find your Google Analytics Id: ... 2385?hl=en

Here is a link on the Affinity Analytics: ... 9950?hl=en

You can get the Google Webmaster tag when you are completing the verification process when setting up the account: ... 5179?hl=en

You get the Bing Webmaster tag when you sign with Bing Webmaster tools as well: ... t-66a806de

3 posts Page 1 of 1

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 1 guest