src/Placement.js
/**
         * Converts a resource's link into one suitable for tracking, making middle-click safe
         * @param type
         * @param resource
         * @param e
         * @private
         */
Converts a resource's link into one suitable for tracking, making middle-click safe
@param type
@param resource
@param e
@private
Converts a resource ' s link into one suitable for tracking making middle - click safe @param type @param resource @param e @private
_handleResourceMouseDown(type, resource, e) {
            const clickId = resource._cid;
            const event = okanjo.metrics.create(this._metricBase, {
                id: resource.id
            })
                .type(type, Metrics.Event.interaction)
                .meta(this.getConfig())
                .meta({ cid: clickId })
                .meta({
                    bf: resource.backfill ? 1 : 0,
                    sf: resource.shortfill ? 1 : 0,
                    spltfl_seg: resource.splitfill_segment || null
                })
                .event(e)
                .element(e.currentTarget)
                .viewport()
                .widget(this.element);
            let trackParam = 'url_track_param';
            let urlParam = 'url';
            if (type === Metrics.Object.product) {
                trackParam = 'buy_url_track_param';
                urlParam = 'buy_url';
            }
            const additionalParams = {
                ok_cid: clickId
            };
            if (resource[trackParam]) additionalParams[resource[trackParam]] = clickId;
            event.data({ ea: Metrics.Action.click });
            e.currentTarget.href = this._getClickThroughURL(event, resource[urlParam], additionalParams);
            resource._clickId = clickId;
            resource._event = event;
            resource._additionalParams = additionalParams;
        }
_handleResourceMouseDown ( type , resource , e ) { const clickId = resource . _cid ; const event = okanjo . metrics . create ( this . _metricBase , { id : resource . id } ) . type ( type , Metrics . Event . interaction ) . meta ( this . getConfig ( ) ) . meta ( { cid : clickId } ) . meta ( { bf : resource . backfill ? 1 : 0 , sf : resource . shortfill ? 1 : 0 , spltfl_seg : resource . splitfill_segment || null } ) . event ( e ) . element ( e . currentTarget ) . viewport ( ) . widget ( this . element ) ; let trackParam = 'url_track_param' ; let urlParam = 'url' ; if ( type === Metrics . Object . product ) { trackParam = 'buy_url_track_param' ; urlParam = 'buy_url' ; } const additionalParams = { ok_cid : clickId } ; if ( resource [ trackParam ] ) additionalParams [ resource [ trackParam ] ] = clickId ; event . data ( { ea : Metrics . Action . click } ) ; e . currentTarget . href = this . _getClickThroughURL ( event , resource [ urlParam ] , additionalParams ) ; resource . _clickId = clickId ; resource . _event = event ; resource . _additionalParams = additionalParams ; }
Converts a resource's link into one suitable for tracking, making middle-click safe
 @param type
 @param resource
 @param e
 @private
Converts a resource ' s link into one suitable for tracking making middle - click safe @param type @param resource @param e @private
// Generate a new click id for this event // const clickId = okanjo.util.shortid(); // Start building the event // Pull the proper params out of the resource depending on it's type // Attach the campaign tracking identifier // Update the link with the event data // Cache this on the product