Skip to content

Script useful for generate fake traffic sources data in Liferay Analytics Cloud

Notifications You must be signed in to change notification settings

joepak/Generate-LFR-AC-traffic-sources

 
 

Repository files navigation

Generate Traffic sources in Liferay's Analytics Cloud

Purpose

Run this script to provide your Analytics Cloud account and your Liferay Portal with some fake data.

We use this script in Tango product team just for developing purposes of our Content Performance Tool, which renders metrics from AC.

  • Clone/fork this repo
  • Install dependencies: npm i or yarn

Usage and configuration

  1. Run a Liferay Portal
  2. Configure AC in your instance settings and visit a page
  3. Open your browser network tool, usually inside the browser's dev tools, you should find a request to AC: image
  4. Use this request url to configure the endpoint property
  5. Use this request payload to extract the data you want to use in the request.
  6. Open ac-config.js file and change the needed values:
{
  "endpoint": "https://osbasahpublisher-ac-asahuat.lfr.cloud/",
  "projectId": "asah0878884185e94d299b56779700af5d43",
  "page": {
    "title": "Home - Liferay",
    "url": "http://liferay.local:8080"
  }
}
  1. In payload.js modify the data you need

Run the script: npm run generate or yarn generate.

By default, the script generates 50 visits per each domain in referrers.js. This setting can be override from the command line just passing the value, ie. for generate 400 visits per domain:

npm run generate 400 or yarn generate 400

A bunch of 200 codes should appear in node console, also an empty array in each request indicates no errors.

image

About

Script useful for generate fake traffic sources data in Liferay Analytics Cloud

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%