GoogleAnalyticsJsFile
in package
implements
GoogleAnalyticsJsFileInterface
Class GoogleAnalyticsJsFile
Interfaces, Classes and Traits
- GoogleAnalyticsJsFileInterface
- Interface GoogleAnalyticsJsFileInterface
Table of Contents
- $allowedTypes : array<string|int, mixed>
- $scriptUrl : string
- $type : string
- __construct() : mixed
- GoogleAnalyticsJsFile constructor.
- analytics() : GoogleAnalyticsJsFile
- Creates an analytics js file type.
- ecPlugin() : GoogleAnalyticsJsFile
- Creates an e-commerce plugin js file type.
- gtag() : GoogleAnalyticsJsFile
- Creates an gtag js file type.
- sourceUrl() : string
- Returns the source url of the analytics file.
- type() : string
- Returns the google analytics javascript file type (gtag, analytics, ec-plugin).
Properties
$allowedTypes
private
static array<string|int, mixed>
$allowedTypes
= ['gtag', 'analytics', 'ec-plugin']
$scriptUrl
private
string
$scriptUrl
$type
private
string
$type
Methods
__construct()
GoogleAnalyticsJsFile constructor.
public
__construct(string $type, string $scriptUrl) : mixed
Parameters
- $type : string
-
Google analytics js file type.
- $scriptUrl : string
-
Url of js file source.
Tags
Return values
mixed —analytics()
Creates an analytics js file type.
public
static analytics() : GoogleAnalyticsJsFile
Return values
GoogleAnalyticsJsFile —ecPlugin()
Creates an e-commerce plugin js file type.
public
static ecPlugin() : GoogleAnalyticsJsFile
Return values
GoogleAnalyticsJsFile —gtag()
Creates an gtag js file type.
public
static gtag(GoogleAnalyticsUaTrackingCode $trackingCode) : GoogleAnalyticsJsFile
Parameters
- $trackingCode : GoogleAnalyticsUaTrackingCode
-
UA Tracking code, required to fetch js source.
Return values
GoogleAnalyticsJsFile —sourceUrl()
Returns the source url of the analytics file.
public
sourceUrl() : string
Return values
string —type()
Returns the google analytics javascript file type (gtag, analytics, ec-plugin).
public
type() : string