Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opt Out without an Iframe #2896

Closed
anonymous-matomo-user opened this issue Jan 31, 2012 · 8 comments
Closed

Opt Out without an Iframe #2896

anonymous-matomo-user opened this issue Jan 31, 2012 · 8 comments
Labels
duplicate For issues that already existed in our issue tracker and were reported previously. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone

Comments

@anonymous-matomo-user
Copy link

http://demo.piwik.org/index.php?module=CoreAdminHome&action=optOut
Hi,
I hate Iframes, because they can't adapt to the screen size of the user. Is there another possibillity to inform the user about his state and peform an Opt Out/In without an iframe?

This would be great =)

@robocoder
Copy link
Contributor

#1929

@anonymous-matomo-user anonymous-matomo-user added this to the 1.7 Piwik 1.7 milestone Jul 8, 2014
@lippoliv
Copy link

lippoliv commented Mar 4, 2016

@mattab @robocoder Please can you give an nice short Statement about why "without an iFrame" is an dupplicate to "custom CSS"?

I don't get it.

I Need an opt out without an iFrame. Thought that is no Problem. Everything is ready, now just the JS AJAX to let piwik know, the user opted out is missing. And now I see: Seems that there is no solution.

PIWIK Team ignores all requests for throwing away that iFrame with info "dupplicate to custom css ticket". That's not what I would do, custom style opt out. I would like to have an custom opt out.

That starts with TEXT. That starts with CSS. That starts with UX. There are multiple reasons to don't load iFrame here.

So please: Do I really have to code my own Plugin to Support AJAX requests for opt out?
An short Statement, why you block requests for "Ajax opt out" would be nice to understand why you do so.

@lippoliv
Copy link

lippoliv commented Mar 8, 2016

For all: I wrote an Plugin for opting out via AJAX. On public interest, I will push it to github.

@mattab
Copy link
Member

mattab commented Mar 15, 2016

Hi @lippoliv - we can always consider adding such feature into core and provide a new API, but it would be even better for you to release your plugin on the Marketplace, so 👍 for this idea!

@chwebo
Copy link

chwebo commented Mar 28, 2016

@lippoliv would you please share your code?
I'd love to integrate it to my website because I built it to a 100% responsive and adding a non responsive iframe is the last thing I wanna do...

@piwik: Please add this feature in your next update, you really should know, that iframes are not state of the art...

@lippoliv
Copy link

@mattab OK as we spoke per Mail I will add to marketplace.

@chwebo Find the Plugin here AjaxOptOut.zip
Just unzip and upload the Folder to PIWIKINSTALL/plugins-Folder.

There are three AJAX-URLs:

  1. index.php?module=API&method=AjaxOptOut.isTracked&format=json, wich Returns if you are tracked or not
  2. index.php?module=API&method=AjaxOptOut.doIgnore&format=json, wich will set the PIWIK Ignore Cookie
  3. index.php?module=API&method=AjaxOptOut.doTrack&format=json, wich will remove the PIWIK Ignore Cookie

IMPORTANT: As of this technique is using Cookies, you have to use JSONP-Requests, instead of just JSON.

Let me know if it works and write me anything wich will not work (you find an Mail-Adress in plugin.json file). I will publish the Plugin ASAP if it works for you too :)

@Lozik
Copy link

Lozik commented Mar 29, 2016

Hi everybody.
Sorry for commenting on this issue, but I wanted to give feedback to the plugin by @lippoliv. (Maybe it would be useful to start a new issue or publish a new "project"?)
Actually, it's not even a real feedback, since it doesn't yet work for me ;)
After uploading the plugin folder to the plugins directory of the Piwik-installation, doesn't the plugin need to be registered in the kernel/core?
For me, visiting the provided paths triggers a standard error-json-response:

The plugin AjaxOptOut is not enabled.

I've looked in the settings > plugins section but there's no entry for that precise plugin. Maybe it's cache related, maybe it needs registration in the core, I can't tell since I'm not aware how Piwik precisely works...
Thanks for any response ;)

Regards.


EDIT:
Sorry, I completely forgot to activate the plugin on the Plugins page...
Everything seems to work. Thank you @lippoliv for your contribution!


EDIT2:
I wanted to add that after installing the plugin and writing an AJAX/JSONP script to communicate with the remote analytics server, it may be necessary to configure the server to accept the API-Call with:
Header set Access-Control-Allow-Origin * in the .htaccess-file or php.ini. ;)

@arno1979
Copy link

arno1979 commented Jun 15, 2016

Hey @lippoliv @Lozik,
I think I need help with this. ;(
I can't get the AJAX/JASONP script to work as I want. The only way the plugin works for me if I use the AJAX-URLs directly on my page. But this leads to a new window with the json response and the other window still displaying the old tracking status.
When I tried to use links triggering an ajax/jsonp request using the enable or disable urls I only got a strange callback response from the url of the page I was on when clicking the link.
@Lozik: Could you maybe post your script or help me in any other way? I'm getting kind of depressed here...

Arno

EDIT:
Just after posting this I found the error in my own AJAX/JASONP script:
I had the link url for the activate/deactivate link dynamically inserted based on the current tracking status. The value returned from the status check was either true or false, but in my if clause I asked for a boolean value when in fact the status check returns a string...
So, in a way posting here helped after all. :)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate For issues that already existed in our issue tracker and were reported previously. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests

7 participants