java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
com.aoapps.ant.tasks.InsertGoogleAnalyticsTrackingTask
- All Implemented Interfaces:
Cloneable
Ant task that invokes
InsertGoogleAnalyticsTracking.addTrackingCodeToZip(java.io.File, java.lang.String)
.- Author:
- AO Industries, Inc.
-
Field Summary
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute()
CallsInsertGoogleAnalyticsTracking.addTrackingCodeToZip(java.io.File, java.lang.String)
with the given ZIP file while logging toTask.log(java.lang.String, int)
.void
The ZIP file to add Google Analytics tracking codes to.void
setGoogleAnalyticsTrackingId
(String googleAnalyticsTrackingId) The modern Google Analytics Global Site Tag tracking ID, which will currently be the Google Analytics 4 (GA4) Measurement ID.Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
Constructor Details
-
InsertGoogleAnalyticsTrackingTask
public InsertGoogleAnalyticsTrackingTask()
-
-
Method Details
-
setFile
The ZIP file to add Google Analytics tracking codes to. Must exist and be a ZIP file. -
setGoogleAnalyticsTrackingId
The modern Google Analytics Global Site Tag tracking ID, which will currently be the Google Analytics 4 (GA4) Measurement ID.- Parameters:
googleAnalyticsTrackingId
- No script will be written whennull
or empty (after trimming)
-
execute
CallsInsertGoogleAnalyticsTracking.addTrackingCodeToZip(java.io.File, java.lang.String)
with the given ZIP file while logging toTask.log(java.lang.String, int)
.- Overrides:
execute
in classTask
- Throws:
BuildException
-