Skip to content

Commit e24394b

Browse files
authored
Merge pull request #715 from melihkorkmaz/populator-utm-params
Added utm paramters to user custom properties for web apps.
2 parents 1544bac + 1d77d0d commit e24394b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

plugins/populator/frontend/public/javascripts/countly.models.js

+11
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,17 @@
105105
if ((Math.random() > 0.5)) {
106106
ob["Has Apple Watch OS"] = (Math.random() > 0.5) ? true : false;
107107
}
108+
109+
if (countlyGlobal.apps[countlyCommon.ACTIVE_APP_ID] && countlyGlobal.apps[countlyCommon.ACTIVE_APP_ID].type === "web") {
110+
var campaigns = ['Social Campaign', 'Landing page', 'Ads Campaign'];
111+
var sources = ["facebook", "gideros", "admob", "chartboost", "googleplay"];
112+
if ((Math.random() > 0.5)) {
113+
ob.utm_source = sources[getRandomInt(0, sources.length - 1)];
114+
ob.utm_medium = "cpc";
115+
ob.utm_campaign = campaigns[getRandomInt(0, campaigns.length - 1)];
116+
}
117+
}
118+
108119
return ob;
109120
}
110121

0 commit comments

Comments
 (0)