Skip to content
This repository was archived by the owner on Jun 20, 2025. It is now read-only.

Commit df0f17d

Browse files
author
Marko Wallin
committed
Fix checking if optional tracker arrays has values
1 parent 4ab4bd6 commit df0f17d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ var PiwikTracker = function(opts) {
222222
push(['setSiteId', opts.siteId]);
223223
push(['setTrackerUrl', u + opts.serverTrackerName]);
224224

225-
if (opts.optionalTrackers && opts.optionalTrackersWebsiteId && !alreadyInitialized) {
225+
if (opts.optionalTrackers.length && opts.optionalTrackersWebsiteId.length ) {
226226
for (var i in opts.optionalTrackers) {
227227
push(['addTracker', opts.optionalTrackers[i], opts.optionalTrackersWebsiteId[i]]);
228228
}

0 commit comments

Comments
 (0)