Skip to content

Commit

Permalink
generate some data for events plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteur committed Sep 30, 2014
1 parent 8b73e59 commit 2e17878
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Generator/VisitsFake.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public function generate($time = false, $idSite = 1, $limit = 1000)
}

if ($this->faker->boolean(10)) {
$i++;
$tracker->doTrackContentImpression('Product 1', '/path/product1.jpg', 'http://product1.example.com');
$tracker->doTrackContentImpression('Product 1', 'Buy Product 1 Now!', 'http://product1.example.com');
$tracker->doTrackContentImpression('Product 2', '/path/product2.jpg', $site['main_url'] . '/product2');
Expand All @@ -103,6 +104,24 @@ public function generate($time = false, $idSite = 1, $limit = 1000)
}
}

if ($this->faker->boolean(10)) {
$i++;
$tracker->doTrackEvent('Movies', 'play', 'Movie Name');

if ($this->faker->boolean(50)) {
$tracker->doTrackEvent('Movies', 'stop', 'Movie Name');
}
}

if ($this->faker->boolean(10)) {
$i++;
$tracker->doTrackEvent('Movies', 'play', 'Another Movie');

if ($this->faker->boolean(50)) {
$tracker->doTrackEvent('Movies', 'stop', 'Another Movie');
}
}

if ($numSearchesDone < $numSearches) {
$tracker->doTrackSiteSearch($this->faker->word, $this->faker->searchEngine, $this->faker->randomNumber(0, 10));
$numSearchesDone++;
Expand Down

0 comments on commit 2e17878

Please sign in to comment.