Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package net.sourceforge.jsdialect.analytics;
 
Thymeleaf processor to collect Google Analytics from a page while fulfilling Spanish Cookies law. See: http://www.pabloburgueno.com/2013/08/sancion-por-incumplir-la-ley-de-cookies/ The law prohibits using GA cookies till the user explicitely accept it. Usage:
 <script js:polite-analytics="AU-2342342-X" />
 
 
    private static final boolean POLITE_ABOUT_COOKIES = true;
    
    private JsDialect dialect;
    public PoliteAnalyticsAttrProcessor(JsDialect dialect) {
        super("polite-analytics");
        this. = dialect;
    }
    @Override
    public int getPrecedence() {
        return . + 1;
    }
    @Override
    public ProcessorResult processAttribute(Arguments argumentsElement elementString attributeName) {
        .addScript(arguments.);
        .addScript(arguments.);
        new AnalyticsCommand(argumentselementattributeNameanalyticsUrl).execute();
        return .;
    }
New to GrepCode? Check out our FAQ X