I want to use "Consent by clicking" option but not for all links on the page. I should be able to specify links that shouldn't consent by clicking.
for example, My banner message has some links, and when users click those links in the banner, that shouldn't be a consent.
(Some pages uses ajax requests to load content and the module consider it as a consent. moved to #2973925: Some pages use click actions triggered by javascript and the module consider it as a consent.)

Comments

khaldoon_masud created an issue. See original summary.

svenryen’s picture

for example, My banner message has some links, and when users click those links in the banner, that shouldn't be a consent.

Wait, are you talking about certain links that when clicked shouldn't trigger a consent, or consent exclusion for all links on entire pages?

Some pages uses ajax requests to load content and the module consider it as a consent.

Do you have an example where this happens, or steps to reproduce? The module itself has ajax requests, but they don't trigger a consent. (And can you agree that we should open a separate issue on this?)

khaldoon_masud’s picture

I am talking about certain links that when clicked shouldn't trigger a consent. example, I am displaying the links of our privacy policy and terms pages in the banner message.

"By continuing to use our site and services, you agree to our use of cookies, our revised [Privacy Policy], and our [Terms of Service]."

But when visitor clicks privacy policy or terms link in the banner, it auto accepts the cookie.

svenryen’s picture

Issue summary: View changes

I have an idea for this. What if we came up with a class selector that when applied to links caused the clicks to bypass the "click to agree"/consent function in the JS?

Would that be sufficient for you if it's properly documented? It's a quick fix and this solution wouldn't add additional clutter in the admin interface.

I'm changing the issue title and description to match your answer in #3.

I also created issue #2973925: Some pages use click actions triggered by javascript and the module consider it as a consent.. Please follow up with steps to reproduce the ajax issue.

khaldoon_masud’s picture

I like the solution. Thanks for doing it.

khaldoon_masud’s picture

Any idea when can I get this patch #4?

svenryen’s picture

@khaldoon_masud - to explain something: I'm currently spending all available spare time working on several issues that are required by the new GDPR legislation. Thank you for following up, you can get this patch from me in late June, July or August. You're also welcome to either provide a patch yourself or ask any colleagues/friends to help out.

khaldoon_masud’s picture

I am working on the patch then. Thanks!

adamps’s picture

Status: Active » Needs review
StatusFileSize
new509 bytes

Here is a simple patch that excludes any clicks on the banner message - this would cover #3 with even needing to add new classes to links.

svenryen’s picture

Thanks for the patch, looks good. I'll take a look later. Due to a birthday out of town this weekend, it will probably be mid August before I can get this committed.

adamps’s picture

Sure, many thanks, have a great weekend

adamps’s picture

StatusFileSize
new513 bytes
new513 bytes

Patch in #9 is bad. Here is a working version with patches for D7/D8.

svenryen’s picture

Not sure if it also works for "a href" links in the banner? The "not" seems applied only to buttons?

adamps’s picture

It works for me on links - NB there is an 'a' at the start of that selector. The patch doesn't change the selector, it just adds the not.

$('a, input[type=submit], button[type=submit]').not('.popup-content *').bind('click.euCookieCompliance',

svenryen’s picture

Sorry, misread. You're right.

svenryen’s picture

Thanks for the patch. It's likely this will make it into the module soon, as there's both a D7 and D8 patch.

svenryen’s picture

Thanks for the patch. Reviewed and tested, all well.

I added a notice to the README.txt about this feature, as it's not obvious without combing through the entire javascript file.

Updated patches attached and committed.

  • svenryen committed 608b1b1 on 8.x-1.x
    Issue #2973700 by AdamPS, svenryen: Consent by clicking option to...

  • svenryen committed 1141c0c on 7.x-1.x
    Issue #2973700 by AdamPS, svenryen: Consent by clicking option to...
svenryen’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

adamps’s picture

Great many thanks @svenryen