function registerAdProperties(rawAd, options) {
        const ad = { ...rawAd, ...JSON.parse(JSON.stringify(options)) };

        ad.adType = (ad.data.getElementsByTagName('Linear').length && 'linear') ||
            (ad.data.getElementsByTagName('NonLinearAds').length && 'nonLinear') || 'unknown';

        [...(ad.wrappers || []), ad.data].filter(Boolean).forEach(dataSource => {
            // Register impressions
            const impression = dataSource.getElementsByTagName('Impression');
            if (impression !== null) {
                playerInstance.registerImpressionEvents(impression, ad);
            }

            // Register viewable impressions
            const viewableImpression = dataSource.getElementsByTagName('Viewable');
            if (viewableImpression !== null) {
                playerInstance.registerViewableImpressionEvents(viewableImpression, ad);
            }

            // Get the error tag, if any
            const errorTags = dataSource.getElementsByTagName('Error');
            if (errorTags !== null) {
                playerInstance.registerErrorEvents(errorTags, ad);
            }

            // Sets CTA from vast
            const [titleCta] = dataSource.getElementsByTagName('TitleCTA');
            if (titleCta) {
                playerInstance.setCTAFromVast(titleCta, ad);
            }

            // Register tracking events
            playerInstance.registerTrackingEvents(dataSource, ad);
            const clickTracks = ad.adType === 'linear' ?
                playerInstance.getClickTrackingEvents(dataSource) :
                playerInstance.getNonLinearClickTrackingEvents(dataSource);
            playerInstance.registerClickTracking(clickTracks, ad);
        });

        ad.sequence = ad.data.attributes.sequence ? Number(ad.data.attributes.sequence.value) : null;
        ad.played = false;

        return ad;
    }
Register Ad element properties to an Ad based on its data and its wrapper data if available

@param {RawAd} rawAd
@param {{ tracking: Array, stopTracking: Array, impression: Array, viewImpression: Array, clicktracking: Array }} options
@returns {Ad}