Google Analytics in Settings

DarkViper

Definitely not.
Website Baker is used by a big amount of people who do not know many/all of the legal regulations. It would be careless of us to offer them options that they can bring into conflict with the law.

If somebody like to use GA anyway, so it's very easy to implement it in the index.php of each template.

[url=http://www.youtube.com/watch?v=tmzDAz6ZvFQ]Der blaue Planet[/url] - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen[br]
[i]"You have to take the men as they are... but you can not leave them like that !" :-P [/i]
[i]Das tägliche Stoßgebet: [b]Oh Herr, wirf Hirn vom Himmel ![/b][/i]

scheltel

DarkViper thanks!

So Google Analytics will not be built-in in future releases?

DarkViper

#4
go into /admin/settings/save.php and search for the Line:

Code (/admin/settings/save.php) Select
<?php

139   $allow_tags_in_fields 
= array('website_header''website_footer');

?>


and add your new datafield to this array.

thats all


take care:
Google Analytics is a very hot iron. Especially in Germany and partly in other EU countries also, you can easily come in conflict with the privacy act and other law. Unawareness does not protect against punishment. That's why we do not include such 'features'.
[url=http://www.youtube.com/watch?v=tmzDAz6ZvFQ]Der blaue Planet[/url] - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen[br]
[i]"You have to take the men as they are... but you can not leave them like that !" :-P [/i]
[i]Das tägliche Stoßgebet: [b]Oh Herr, wirf Hirn vom Himmel ![/b][/i]

scheltel

I did not make any changes in save.php.

I have added the following 2 lines to /admin/settings/index.php

   $template->set_var(array(
                        [.... standard coding v2.8.2 ...]                        'HEADING_GOOGLE_ANALYTICS_SETTINGS' => $HEADING['GOOGLE_ANALYTICS_SETTINGS']                        
                        )
                  );

   // Insert language text and messages
   $template->set_var(array(
                        [.... standard coding v2.8.2 ...]
                        'TEXT_GOOGLE_ANALYTICS_DESCRIPTION' => $TEXT['GOOGLE_ANALYTICS_DESCRIPTION']
                        ));

Added to /templates/wb_theme/templates/settings.htt

<tr>
   <td colspan="3" style="padding-top: 10px;">
      <h2>{HEADING_GOOGLE_ANALYTICS_SETTINGS}</h2>
   </td>
</tr>
<tr>
   <td class="setting_name">{TEXT_GOOGLE_ANALYTICS_DESCRIPTION}</td>
   <td class="setting_value" colspan="2">
      <textarea name="google_analytics">{GOOGLE_ANALYTICS}</textarea>
   </td>
</tr>
<tr>
   <td>&nbsp;</td>
   <td>
      <input type="submit" name="submit" value="{TEXT_SAVE}" class="save" />
      <input type="reset" name="reset" value="{TEXT_RESET}" class="reset" />
   </td>
</tr>


Added to /install/save.php

   $settings_rows=   "INSERT INTO `".TABLE_PREFIX."settings` "
   ." (name, value) VALUES "
[.... standard coding v2.8.2 ...]
   ." ('google_analytics', '')";
   $database->query($settings_rows);


Added to /languages/[language].php
$TEXT['GOOGLE_ANALYTICS_DESCRIPTION'] = 'Google Analytics String';
$HEADING['GOOGLE_ANALYTICS_SETTINGS'] = 'Google Analytics Settings';


Added to /templates/[TEMPLATE_NAME]/index.php

if (function_exists('get_google_analytics')) { get_google_analytics(); }
?>
</body>


See attachment...

badknight

show us the changes from the save.php you made for this.. maybe ther is something wrong
Ich würde gern die Welt verändern, doch Gott gibt mir den Quellcode nicht...

scheltel

I want to extend the settings form to enter the Google Analytics String.

I have modified the code, but when I'm trying to save the settings,  the script tags are not submitted to the database. It seems that there anti-cross site scripting measurements are taken. Is this true? And if so, how can I bypass this behavior?


[gelöscht durch Administrator]