From 499f5b76831bfe4218f8010ac6346efbe70dfbc5 Mon Sep 17 00:00:00 2001 From: roynahmias Date: Wed, 3 Aug 2022 16:01:35 +0300 Subject: [PATCH] Added support for multiple pixel ids --- index.js | 8 ++++++-- package.json | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 07a4d05a..655b8e27 100644 --- a/index.js +++ b/index.js @@ -5,8 +5,12 @@ module.exports = { name: 'ember-cli-fbq', contentFor: function(type, config) { - if (type === 'head-footer' && config.fbq && config.fbq.enabled && config.fbq.id) { - return '' + if (type === 'head-footer' && config.fbq && config.fbq.enabled && config.fbq.ids) { + let initIds = ''; + config.fbq.ids.forEach(id => { + initIds += 'fbq("init", "' + id + '");' + }); + return '' } } }; diff --git a/package.json b/package.json index 98cfcdcf..11a57c3a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ember-cli-fbq", - "version": "2.0.0", + "version": "3.0.0", "description": "An Ember CLI Addon to add support for Facebook Pixel", "keywords": [ "ember-addon",