{"id":57634,"date":"2016-05-27T08:40:38","date_gmt":"2016-05-27T12:40:38","guid":{"rendered":"http:\/\/www.templatemonster.com\/help\/?p=57634"},"modified":"2017-07-25T06:38:50","modified_gmt":"2017-07-25T10:38:50","slug":"monstroid-how-to-add-google-analytics-code","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/monstroid-how-to-add-google-analytics-code.html","title":{"rendered":"Monstroid. How to add Google Analytics code"},"content":{"rendered":"<p>This tutorial will guide you through adding Google Analytics code to Monstroid templates.<\/p>\r\n<div class=\"video-container\">\r\n\t<iframe src=\"https:\/\/www.youtube.com\/embed\/sK450Xvxptw\"><\/iframe>\r\n<\/div>\r\n\r\n<h3 class=\"custom\">Getting Google Analytics code<\/h3>\r\n\r\n<ol>\r\n<li><p>Sign into your Google Analytics account.<\/p><\/li>\r\n<li><p>Click the <strong>Admin<\/strong> tab.<\/p><\/li>\r\n<li><p>Select <strong>Account<\/strong> from the <strong>Account<\/strong> column.<\/p><\/li>\r\n<li><p>Select <strong>Property<\/strong> on the next column.<\/p><\/li>\r\n<li><p>Under Property select <strong>Tracking Info<\/strong> > <strong>Tracking Code<\/strong> option:<\/p>\r\n<a href=\"\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_1.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_1-300x178.jpg\" alt=\"Monstroid._How_to_add_Google_Analytics_code_1\" width=\"300\" height=\"178\" class=\"aligncenter size-medium wp-image-65580\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_1-300x178.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_1-150x89.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_1-1024x608.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_1.jpg 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n<\/li>\r\n<li><p>Copy Tracking code:<\/p>\r\n\r\n<a href=\"\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_2.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_2-300x173.jpg\" alt=\"Monstroid._How_to_add_Google_Analytics_code_2\" width=\"300\" height=\"173\" class=\"aligncenter size-medium wp-image-65581\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_2-300x173.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_2-150x87.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_2-1024x592.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_2.jpg 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n<\/li>\r\n<\/ol>\r\n\r\n<h3 class=\"custom\">Adding Google Analytics tracking code to your site.<\/h3>\r\n<div class=\"inline-banner\">\r\n<a href=\"https:\/\/www.templatemonster.com\/service-center\/\">\r\n<img src=\"\/help\/files\/banners\/inline\/Banner-3-(835-x100).jpg\" \/>\r\n<\/a>\r\n<\/div>\r\n\r\n<ol>\r\n<li><p>Log into your WordPress admin panel.<\/p><\/li>\r\n<li><p>Navigate to <strong>Cherry<\/strong>  > <strong>Options<\/strong> section:<\/p>\r\n\r\n<a href=\"\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_3.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_3-300x178.jpg\" alt=\"Monstroid._How_to_add_Google_Analytics_code_3\" width=\"300\" height=\"178\" class=\"aligncenter size-medium wp-image-65582\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_3-300x178.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_3-150x89.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_3-1024x608.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_3.jpg 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n<\/li>\r\n<li><p>Enter you Tracking code to the <strong>Google Analytics code<\/strong> field under <strong>General<\/strong> tab:<\/p>\r\n\r\n<a href=\"\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_4.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_4-300x169.jpg\" alt=\"Monstroid._How_to_add_Google_Analytics_code_4\" width=\"300\" height=\"169\" class=\"aligncenter size-medium wp-image-65583\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_4-300x169.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_4-150x84.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_4-1024x576.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_4.jpg 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n<\/li>\r\n<li><p>Click Save options.<\/p><\/li>\r\n<\/ol>\r\n\r\n<p class=\"attention\">Note that <strong>Google Analytics block<\/strong> was added into Cherry Options <strong>starting from the template 55966 +<\/strong>. In case your template number is lower than 55966, follow the steps below:<\/p>\r\n<ol>\r\n<li><p>Open <strong>&#8216;wp-content\/themes\/themeXXXXX\/functions.php&#8217;<\/strong> file:<\/p>\r\n\r\n<a href=\"\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_5.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_5-300x163.jpg\" alt=\"Monstroid._How_to_add_Google_Analytics_code_5\" width=\"300\" height=\"163\" class=\"aligncenter size-medium wp-image-65584\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_5-300x163.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_5-150x81.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_5.jpg 890w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n<\/li>\r\n<li><p><strong>Add<\/strong> the following code to the very end of the file: <\/p>\r\n<pre class=\"brush:php\">\r\nadd_filter( 'cherry_general_options_list', 'themeXXXX_new_settings' );\r\n  function themeXXXX_new_settings( $options ) {\r\n  $new_options = array(\r\n  'google_analytics' =&gt; array(\r\n  'type'        =&gt; 'textarea',\r\n  'title'       =&gt; __( 'Google Analytics Code', 'themeXXXX' ),\r\n  'description' =&gt; __( 'You can paste your Google Analytics or other tracking code in this box. This will be automatically added to the footer.', 'themeXXXX' ),\r\n  'value'       =&gt; '',\r\n  )\r\n  );\r\n  $options = array_merge( $options, $new_options );\r\n return $options;\r\n  }\r\nadd_filter( 'wp_footer', 'themeXXXX_google_analytics', 9999 );\r\n  function themeXXXX_google_analytics () {\r\n  if ( cherry_get_option( 'google_analytics' ) ) {\r\n  echo '&lt;script&gt;'.cherry_get_option( 'google_analytics' ).'&lt;\/script&gt;';\r\n  }\r\n  }\r\n\r\n<\/pre>\r\n<\/li>\r\n<li><p><strong>Save<\/strong> the changes.<\/p><\/li>\r\n\r\n<li><p>Clear your browser cache and navigate to <strong>Cherry Options > General<\/strong> tab. Google Analytics block should appear at the very bottom of the page.<\/p><\/li>\r\n<li><p>Enter you Tracking code to the <strong>Google Analytics code<\/strong> field under <strong>General<\/strong> tab:<\/p>\r\n\r\n<a href=\"\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_4.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_4-300x169.jpg\" alt=\"Monstroid._How_to_add_Google_Analytics_code_4\" width=\"300\" height=\"169\" class=\"aligncenter size-medium wp-image-65583\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_4-300x169.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_4-150x84.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_4-1024x576.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/03\/Monstroid._How_to_add_Google_Analytics_code_4.jpg 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n<\/li>\r\n<li><p>Click Save options.<\/p><\/li>\r\n<\/ol>\r\n\r\n<p>Feel free to check the detailed video tutorial below:<\/p>\r\n\r\n<a href=\"http:\/\/www.youtube.com\/watch?v=sK450Xvxptw?width=1280&amp;height=720\" rel=\"prettyPhoto\">Monstroid. How to add Google Analytics code<\/a>","protected":false},"excerpt":{"rendered":"<p>This tutorial will guide you through adding Google Analytics code to Monstroid templates.<\/p>\n","protected":false},"author":37,"featured_media":57640,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2017,728],"tags":[1043,859,929,2019],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/57634"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/37"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=57634"}],"version-history":[{"count":1,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/57634\/revisions"}],"predecessor-version":[{"id":82186,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/57634\/revisions\/82186"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/57640"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=57634"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=57634"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=57634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}