class GoogleAnalyticsManager implements BasicEntityManagerInterface

Class GoogleAnalyticsManager is injected as empire_google_analytics_plugin.google_analytics_manager service. GoogleAnalyticsManager handles the logic for managed entity.

Constants

UPLOAD_DIR

UPLOAD_DIR_PATH

CONFIG_FILE_NAME

VIEW_CACHE_KEY

TRACKING_CACHE_KEY

Methods

__construct(ProductManager $productManager, OrderManager $orderManager, GoogleAnalyticsConfigRepository $repository, Redis $client)

GoogleAnalyticsManager constructor.

array
getProductsFromList(array $array)

Get product information with additional params (Brand name and Category Name concat)

array
createImpressionsResponse(array $data, array $dbData)

Create impressions response

array
getOrderForGoogleAnalytics(int $orderId)

Get order with custom information - used to send data to Google Analytics

mixed
getGoogleAnalyticsToken()

Get google analytics token

mixed
getConfigFile()

Check if configuration file exists

getConfig()

Get google analytics config

bool
saveConfig(string $trackingId, string $viewId, array $fileArray)

Save google analytics configuration

bool
removeConfig()

Remove google analytics configuration from database and file

reCacheData()

Re-cache google analytics configuration

cacheData(string $trackingId, string $viewId)

Set google analytics params to cache

bool
getCacheData(string $key)

Get data from cache by key

Details

at line 67
__construct(ProductManager $productManager, OrderManager $orderManager, GoogleAnalyticsConfigRepository $repository, Redis $client)

GoogleAnalyticsManager constructor.

Parameters

ProductManager $productManager
OrderManager $orderManager
GoogleAnalyticsConfigRepository $repository
Redis $client

at line 81
array getProductsFromList(array $array)

Get product information with additional params (Brand name and Category Name concat)

Parameters

array $array

Return Value

array

at line 93
array createImpressionsResponse(array $data, array $dbData)

Create impressions response

Parameters

array $data
array $dbData

Return Value

array

at line 113
array getOrderForGoogleAnalytics(int $orderId)

Get order with custom information - used to send data to Google Analytics

Parameters

int $orderId

Return Value

array

at line 122
mixed getGoogleAnalyticsToken()

Get google analytics token

Return Value

mixed

at line 145
mixed getConfigFile()

Check if configuration file exists

Return Value

mixed

at line 158
GoogleAnalyticsConfig|boolean getConfig()

Get google analytics config

Return Value

GoogleAnalyticsConfig|boolean

at line 171
bool saveConfig(string $trackingId, string $viewId, array $fileArray)

Save google analytics configuration

Parameters

string $trackingId
string $viewId
array $fileArray

Return Value

bool

at line 202
bool removeConfig()

Remove google analytics configuration from database and file

Return Value

bool

at line 217
GoogleAnalyticsConfig reCacheData()

Re-cache google analytics configuration

Return Value

GoogleAnalyticsConfig

at line 233
cacheData(string $trackingId, string $viewId)

Set google analytics params to cache

Parameters

string $trackingId
string $viewId

at line 245
bool getCacheData(string $key)

Get data from cache by key

Parameters

string $key

Return Value

bool