@Component(value="blGoogleAnalyticsProcessor") public class GoogleAnalyticsProcessor extends AbstractModelVariableModifierProcessor
<blc:googleAnalytics th:attr="orderNumber=${order != null ? order.orderNumber : null}" />
<script th:utext="${analytics}" />
| Modifier and Type | Field and Description |
|---|---|
protected String |
affiliation |
protected OrderService |
orderService |
protected boolean |
testLocal
This will force the domain to 127.0.0.1 which is useful to determine if the Google Analytics tag is sending
a request to Google
|
protected String |
webPropertyId |
| Constructor and Description |
|---|
GoogleAnalyticsProcessor()
Sets the name of this processor to be used in Thymeleaf template
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
analytics(String webPropertyId,
Order order)
Documentation for the recommended asynchronous GA tag is at:
http://code.google.com/apis/analytics/docs/tracking/gaTrackingEcommerce.html
|
String |
getAffiliation() |
protected Address |
getBillingAddress(Order order) |
int |
getPrecedence() |
boolean |
getTestLocal() |
protected String |
getVariation(OrderItem item)
Returns the product option values separated by a space if they are
relevant for the item, or the product category if no options are available
|
protected void |
modifyModelAttributes(org.thymeleaf.Arguments arguments,
org.thymeleaf.dom.Element element) |
void |
setAffiliation(String affiliation) |
protected void |
setTestLocal(boolean testLocal) |
addToModel, processElementdoProcess, getMatcherprotected OrderService orderService
@Value(value="${googleAnalytics.webPropertyId}")
protected String webPropertyId
@Value(value="${googleAnalytics.affiliation}")
protected String affiliation
protected boolean testLocal
public GoogleAnalyticsProcessor()
public int getPrecedence()
getPrecedence in class org.thymeleaf.processor.AbstractProcessorprotected void modifyModelAttributes(org.thymeleaf.Arguments arguments,
org.thymeleaf.dom.Element element)
modifyModelAttributes in class AbstractModelVariableModifierProcessorprotected String analytics(String webPropertyId, Order order)
webPropertyId - - Google Analytics IDorder - - optionally track the order submission. This should be
included on the page after the order has been sucessfully
submitted. If null, this will just track the current pageprotected String getVariation(OrderItem item)
protected void setTestLocal(boolean testLocal)
public boolean getTestLocal()
public String getAffiliation()
public void setAffiliation(String affiliation)
Copyright © 2013. All Rights Reserved.