Skip to content

Commit 54a8aba

Browse files
authored
Fixes Purchase content type (segmentio#63)
* Fixes the wrong default for Purchase * Fixes failing tests * Bumps version to 2.5.2
1 parent 3a4e35e commit 54a8aba

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

integrations/facebook-pixel/HISTORY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2.5.2/ 2018-09-13
2+
==================
3+
4+
* Fixes the wrong content type for Order Completed
5+
16
2.5.1 / 2018-09-10
27
==================
38

integrations/facebook-pixel/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ FacebookPixel.prototype.orderCompleted = function(track) {
281281

282282
// Order completed doesn't have a top-level category spec'd.
283283
// Let's default to the category of the first product. - @gabriel
284-
var contentType = ['product_group'];
284+
var contentType = ['product'];
285285
if (products.length) {
286286
contentType = this.mappedContentTypesOrDefault(products[0].category, contentType);
287287
}

integrations/facebook-pixel/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@segment/analytics.js-integration-facebook-pixel",
33
"description": "The Facebook Pixel analytics.js integration.",
4-
"version": "2.5.1",
4+
"version": "2.5.2",
55
"keywords": [
66
"analytics.js",
77
"analytics.js-integration",

integrations/facebook-pixel/test/index.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ describe('Facebook Pixel', function() {
475475
});
476476
analytics.called(window.fbq, 'track', 'Purchase', {
477477
content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'],
478-
content_type: ['product_group'],
478+
content_type: ['product'],
479479
currency: 'USD',
480480
value: '0.50'
481481
});
@@ -493,7 +493,7 @@ describe('Facebook Pixel', function() {
493493
});
494494
analytics.called(window.fbq, 'track', 'Purchase', {
495495
content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'],
496-
content_type: ['product_group'],
496+
content_type: ['product'],
497497
currency: 'USD',
498498
value: '0.50'
499499
});

0 commit comments

Comments
 (0)