leichter / cwrx

(Old) Cinema6 API
0 stars 0 forks source link

Content service should return tracking links for shares. #663

Closed howardengelhart closed 8 years ago

howardengelhart commented 8 years ago

Needs to be broken out by share-site.. ie share-facebook, share-twitter, share-pinterest.

Ref: cinema6/minireelinator#1032

leichter commented 8 years ago

@minznerjosh @howardengelhart This will be handled basically the same as the card's links hash.

Currently, the shareLinks hash on a card looks like this:

card.shareLinks = {
    facebook: "http://mypage.com/from/facebook",
    twitter: "http://mypage.com/from/twitter",
  };

When a card is retrieved from a public endpoint, each value in the shareLinks hash will be transformed into an object like so:

card.shareLinks = {
    facebook: {
        uri: 'http://mypage.com/from/facebook',
        tracking: [
            '//cinema6.com/pixel.gif?params'
        ]
    },
    twitter: {
        uri: 'http://mypage.com/from/twitter',
        tracking: [
            '//cinema6.com/pixel.gif?params'
        ]
    }
};

The params on the tracking pixel urls will be the same as those on other tracking urls, but the event param will be set to shareLink.<key>, e.g. shareLink.facebook and shareLink.twitter for these examples.

leichter commented 8 years ago

Also, like the links hash, the code will handle the possibility that entries in the shareLink hash are already objects with a tracking array defined, and simply add pixel urls to the preexisting array.

leichter commented 8 years ago

Closed by #665