Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Piwik as a self serve hosted web analytics solution #1148

Closed
mattab opened this Issue · 41 comments

5 participants

@mattab
Owner

Is is a very common feature request that users want to have their Piwik as a self serve tool where new users can register themselves and existing users can add new websites.

This ticket is a placeholder to gather requirements on such a feature. We don't plan to implement this in Piwik 1.0 but there might be enough interested users & developers to get this feature built and integrated in core.

List of features:

  • Below the login screen, a new link to "Register".
  • The Register screen would contain the standard field (login, password, email, name) using the login screen html/css styles. During registration, a user would also setup their first website (website name, URL).
  • Once the registration is complete (directly or after validation by the Piwik super user), the user can access the Piwik interface and get the Javascript tag.

Notes

  • A user creating a website would be "admin" for this website. He can create other users and give them access to the stats.
  • New setting: Allow users to register themselves and create websites Y/N
  • New setting: Allow existing users to create new websites Y/N

Outstanding questions

  • We need to ensure that users providing a self hosted Piwik do not use the Piwik and rebrand their offering.
  • if one was to bill for the service, how would this be handled?
  • if a large website comes in and adds the Piwik tag, this would severely impact/break other websites' performance. How is this handled? Some sort of security in the tracker is necessary to block all new writes from a website that is using too much resource.

Please post your thoughts and new requirements in a comment to this ticket. Also if you are interested to build this feature, post a comment.

Want this feature implemented and released in Piwik?

Contact a Piwik consultant today! http://piwik.org/consulting/
Keywords: self, hosted, hosted, register, registration, service, third-party-plugin

@anonymous-piwik-user

maybe its possible to limit the traffic to websites for tracking, that you can say, a specific website should not exceed 10000 users per day, and if so, the tracking should be simply disabled and the owner notified.

i would like to see this feature for piwik!

@anonymous-piwik-user

Limit the number of websites a user can create. So, admin can set up a number (per user) to which the user can create websites. If the number is zero then it is unlimited.

@zawadzinski
Owner

attaching signup plugin + patch for lang/en.php and config/global.inc.php files (there is an option to enable/disable captcha).

Currently the plugin does not add a link to Login form, so in order to see the signup form call directly: index.php?module=Signup

@zawadzinski
Owner

setting it as a new plugin (some people asked me for it, so let's put it in the plugin directory before it gets into core)

@anonymous-piwik-user

Does this still work with 1.1? I am getting some template errors when I navigate to the signup page.

I get the following errors:

Notice: Undefined index: enableFramedLogins in /home/a389951l/public_html/piwik/tmp/templates_c/%%A9^A91^A917CA4A%%header.tpl.php on line 14

@mattab
Owner

a389951l, can you try and delete your /home/a389951l/public_html/piwik/tmp/templates_c files and refresh? please report if you still see the error

@robocoder
Collaborator

Signup_Controller needs to set the missing variables used by the login template. See https://github.com/piwik/piwik/blob/master/plugins/Login/Controller.php

@anonymous-piwik-user

Matt - I tried to delete the templates_c files and I still get the errors.

Replying to matt:

a389951l, can you try and delete your /home/a389951l/public_html/piwik/tmp/templates_c files and refresh? please report if you still see the error

@mattab
Owner

See also 'Logo customize' feature request: #2008

@anonymous-piwik-user

Hi vipsoft and matt
I have a same problem:
Matt - I tried to delete the templates_c files and I still get the errors.
and
vipsoft - I change Signup_Controller.

@mattab
Owner

(In [3854]) Refs #1148 Prevent error in Signup plugin in 1.1.1

@mattab
Owner

a389951l and akonews, please apply the patch in: [3854] and this fixes the error message. Don't forget to also apply the patch listed in this ticket: http://issues.piwik.org/attachments/1148/signup.patch

@mattab
Owner

There is an error in the SignUp plugin JS code sent by email: http://forum.piwik.org/read.php?2,73661

@anonymous-piwik-user

After signing-up, the Javascript code displayed is sort of garbled. The same code is then sent by email to the user and is, again, received garbled.

Fix:

(a) File Signup/templates/success.tpl - line 17, remove [ |escape:'htmlall' ] from the line

(b) Edit the language file to disable sending the code in mail. Instead instruct users to get it from the Dashboard. This is in the additional language added for Sign up.

Edit 'Signup_MailBody' to look like this:

'Signup_MailBody' => "Hi %1\$s!\n\nYou have successfully signed up for an account. \n\nYour Username:\t%2\$s\nYour Password:\t%3\$s\nLogin URL:\t%4\$s\n\nTo count all visitors, you must insert the JavaScript code available inside your Dashboard: Settings > Websites > View Tracking Code.\n\nSincerely,\nPiwik Open Source Analytics%5",

@mattab
Owner

ssgupta, if you could post the updated ZIP including these fixes it would be useful thanks!

@anonymous-piwik-user

Hello,
there is another problem! I want that my users will be able to add more websites. Now new users can have only one website. How I can change that?

@anonymous-piwik-user

Error in Signup page after update Piwik 1.4 --> 1.5.

There is an error. Please report the message and full backtrace in the Piwik forums (please do a Search first as it might have been reported already!).

Notice: Undefined index: isCustomLogo in /home/director/public_html/Piwik/tmp/templates_c/%%A9^A91^A917CA4A%%header.tpl.php on line 78

Backtrace -->
#0 Piwik_ErrorHandler(8, 1 => 'Undefined index: isCustomLogo', 2 => '/home/director/public_html/Piwik/tmp/templates_c/%%A9^A91^A917CA4A%%header.tpl.php', 3 => 78, 4 => array ('this' => Piwik_Smarty::__set_state(array('template_dir' => array (0 => '/home/director/public_html/Piwik/plugins', 1 => '/home/director/public_html/Piwik/themes/default', 2 => '/home/director/public_html/Piwik/themes'), 'compile_dir' => '/home/director/public_html/Piwik/tmp/templates_c', 'config_dir' => 'configs', 'plugins_dir' => array (0 => '/home/director/public_html/Piwik/core/SmartyPlugins', 1 => '/home/director/public_html/Piwik/libs/Smarty/plugins'), 'debugging' => false, 'error_reporting' => '6143', 'debug_tpl' => '', 'debugging_ctrl' => 'NONE', 'compile_check' => true, 'force_compile' => false, 'caching' => 0, 'cache_dir' => '/home/director/public_html/Piwik/tmp/cache', 'cache_lifetime' => 3600, 'cache_modified_check' => false, 'php_handling' => 0, 'security' => false, 'secure_dir' => array (), 'securit...#1 include('/home/director/public_html/Piwik/tmp/templates_c/%%A9^A91^A917CA4A%%header.tpl.php') called at [Smarty->_smarty_include(array ('smarty_include_tpl_file' => 'Login/templates/header.tpl', 'smarty_include_vars' => array ())) called at /home/director/public_html/Piwik/tmp/templates_c/%%6E^6E8^6E83E5D4%%register.tpl.php:6#3 include('/home/director/public_html/Piwik/tmp/templates_c/%%6E^6E8^6E83E5D4%%register.tpl.php') called at [Smarty->fetch('/home/director/public_html/Piwik/plugins/Signup/templates/register.tpl') called at /home/director/public_html/Piwik/core/View.php:138#5 Piwik_View->render(array () called at [Piwik_Signup_Controller->register(array () called at /home/director/public_html/Piwik/plugins/Signup/Controller.php:19#7 Piwik_Signup_Controller->index(array () called at [call_user_func_array(array (0 => Piwik_Signup_Controller::__set_state(array('pluginName' => 'Signup', 'strDate' => NULL, 'date' => NULL, 'idSite' => 0, 'site' => Piwik_Site::__set_state(array('id' => 0)))), 1 => 'index'), 1 => array ()) called at /home/director/public_html/Piwik/core/FrontController.php:127#9 Piwik_FrontController->dispatch(array () called at [/home/director/public_html/Piwik/index.php:53]

What can I do?

Razvan

@robocoder
Collaborator

In Signup/Controller.php, insert
$this->setBasicVariablesView($view);
before the two occurences
echo $view->render();

@anonymous-piwik-user

Anyone get this thing working? I have tried running the "patch" command to for the patch file but it just fails. What files do you actually edit if you were to do it manually. This is the code from the patch:

Index: config/global.ini.php
===================================================================
--- config/global.ini.php   (revision 3324)
+++ config/global.ini.php   (working copy)
@@ -55,6 +55,9 @@
 ; this option must be set to 1 when adding, removing or modifying javascript and css files
 disable_merged_assets = 0

+[Signup]
+enable_captcha = 0
+
 [General]
 ; character used to automatically create categories in the Actions > Pages, Outlinks and Downloads reports
 ; for example a URL like "example.com/blog/development/first-post" will create 
Index: lang/en.php
===================================================================
--- lang/en.php (revision 3324)
+++ lang/en.php (working copy)
@@ -1191,4 +1191,13 @@
    'PDFReports_AreYouSureYouWantToDeleteReport' => 'Are you sure you want to delete this PDF Report and its schedule?',
    'PDFReports_ThereIsNoPDFReportToManage' => 'There is no PDF Report to manage for website %s',
    'PDFReports_YouMustBeLoggedIn' => 'You must be logged in to create and schedule custom PDF Reports.',
+   'Signup_InvalidWebsiteURL' => 'Invalid website URL. Enter full URL with http:// prefix.',
+   'Signup_Captcha' => 'Enter text from image above',
+   'Signup_InvalidCaptcha' => 'Invalid text from image.',
+   'Signup_Signup' => 'Sign up',
+   'Signup_Intro' => 'Please fill this form to sign up for Piwik account.',
+   'Signup_ProceedDashboard' => 'Proceed to Dashboard',
+   'Signup_CompleteMessage' => 'Sign up complete!<br /><br />Make sure your JavaScript code is entered on your pages, and wait for your first visitors!<br /><br />We will receive an email with confirmation shortly.',
+   'Signup_MailSubject' => 'Signup complete',
+   'Signup_MailBody' => "Hi %1\$s,\n\nYou have successfully sign up for Piwik account. \n\n Your username:\t%2\$s\n Your password: \t%3\$s\n Login URL: \t%4\$s\n\nTo count all visitors, you must insert the JavaScript code (below) on all of your pages.\n\n%5\$s",
 );

Also, what do you do with the "signup-language.txt" file? I should probably be able to figure this out but for some reason have not been able too.

I hope to see this plugin in 1.6!

@mattab
Owner

We hope to fix the few bugs and add a few features in this plugin in the next few weeks. Stay tuned!

@mattab
Owner

See also ideas of settings in: #1568

@anonymous-piwik-user

Hello, i would install this singup, but i have only error. can any body me help.

email: support@swonpy.de

dear sven

@anonymous-piwik-user

So is this plugin working?

@anonymous-piwik-user

No, piwik work yes, but not this creat tool :-)

@anonymous-piwik-user

Shame, Piwik will always be a backup analytics tool without having a self serve option

@anonymous-piwik-user

Hi everyone!
I was writing about this plugin for a book I am writing on Piwik and realized that I had to read the whole thread to get the plugin working. So I put together all the changes and have a working signup form on my site. I also added a README file for those people that don't know how to use the patch files and zipped it together to upload here, just to make it easier on the next guy and to finish the chapter I had time invested in.

@anonymous-piwik-user

And that new Signup.zip upload was working in 1.7.1. The 1.17 number was a typo.

@mattab
Owner

eristoddle, thank you very much for posting the updated version of the plugin!

If anyone is using the plugin with success or have any feedback, please post a comment.

@anonymous-piwik-user

I just added a new version.

  • Readme now says to edit config.ini.php and not global.ini.php
  • Success form no longer escapes your tracking code which made it useless.
@anonymous-piwik-user

Oh, and this works up to 1.8.3.

@mattab
Owner

Thanks @eristoddle for the update.

Note: I deleted the other old files and only put up the latest version to keep things simple!

@mattab
Owner

Oops I deleted the translation patch.

instead the translation en.php should be in the lang/ folder of the plugin Signup/lang/

and the plugin getInformation() function should contain 'translationAvailable' => true, to have piwik pick up this translation file.

If someone would be willing to update & test it would be great!


'Signup_InvalidWebsiteURL' => 'Invalid Website URL. Enter full URL
with http:// prefix.',
'Signup_Captcha' => 'Enter text from image above',
'Signup_InvalidCaptcha' => 'Invalid text from image.',
'Signup_Signup' => 'Sign Up',
'Signup_Intro' => 'Please fill this form to sign up for an
account.',
'Signup_ProceedDashboard' => 'Proceed to Dashboard',
'Signup_CompleteMessage' => 'Sign up Complete!<br /><br />Make
sure your JavaScript code is entered in your pages, and wait for
your first visitors.<br /><br />You will receive an email with
confirmation shortly.',
'Signup_MailSubject' => 'Signup Complete',
'Signup_MailBody' => "Hi %1\$s!\n\nYou have successfully signed up
for an account. \n\nYour Username:\t%2\$s\nYour
Password:\t%3\$s\nLogin URL:\t%4\$s\n\nTo count all visitors, you
must insert the JavaScript code available inside your Dashboard:
Settings > Websites > View Tracking Code.\n\nSincerely,\nPiwik
Open Source Analytics%5",

@anonymous-piwik-user

I updated the plugin with it's own en.php file.

@mattab
Owner

Attachment: New plugin to allow users to signup to Piwik!
Signup.zip

@anonymous-piwik-user

Hello,
Piwik 1.8.4 don't work with GeoIp and Signup widgets (fresh install).
What changes should be made to the widgets that work with Piwik 1.8.4 ?

@anonymous-piwik-user

Tested on Piwik 1.9.2, everything else works, except this plugin. NO sign up form appears, or anything else.
I installed it as per the instructions included in your readme. Do you know when a working version will be released? I'd even be interested in a working alpha or beta version ;-)

-k0nsl

@halfdan
Collaborator

For future changes please refer to the repository by Stephan on Github: https://github.com/eristoddle/PiwikSignupPlugin

@anonymous-piwik-user

I get this plugin worked when rename folder to Signup, this is necessary by plugin convention. Registration form is accessible by register url index.php?module=Signup&action=index . For example http://localhost/index.php?module=Signup&action=index . I cannot find some login form/page hook for extending it with some register link and maybe we should change the login template (ugly approach)

@anonymous-piwik-user

hi

When I installed the plugin on piwik 1.11.1 , Tracking for all websites be disabled !!!

please help

thank you

@anonymous-piwik-user

Not working in V2.0 !

@mattab
Owner

Thank you everyone for your feedback on the plugin. Currently I believe this plugin is not working with Piwik 2.0. We would be happy to update it for you. Please contact us via: http://piwik.org/consulting/

In the meantime, we hope you enjoy Piwik! Cheers

@mattab mattab added the R: worksforme label
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.