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

Liquid CanTrack tag (OSOE-644) #63

Open
Piedone opened this issue Jun 8, 2023 · 0 comments
Open

Liquid CanTrack tag (OSOE-644) #63

Piedone opened this issue Jun 8, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Piedone
Copy link
Member

Piedone commented Jun 8, 2023

If you want to conditionally do something in Liquid that depends on the user having given consent to tracking, you can't really do that, since you can't access ITrackingConsentFeature. So, let's add a Liquid tag that provides this information as a bool that you can use in ifs. Essentially, we want to be able to do the equivalent of this in Liquid:

var trackingConsentFeature = _hca.HttpContext.Features.Get<ITrackingConsentFeature>();

if (trackingConsentFeature is null || trackingConsentFeature.CanTrack)
{
     // Only insert the tracking script here.
}

This would be useful for including custom analytics scripts in DotNest Media Themes (though for DotNest OrchardCMS/OrchardCore#13825 would work too).

Jira issue

@Piedone Piedone added the enhancement New feature or request label Jun 8, 2023
@github-actions github-actions bot changed the title Liquid CanTrack tag Liquid CanTrack tag (OSOE-644) Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant