Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.3 kB
4
Indexable
Never
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://sdk.teester.com/loader.js";
document.getElementsByTagName("head")[0].appendChild(script);

window.onTeesterReady = window.onTeesterReady || [];
window.onTeesterReady.push(function (SDK) {

    var playerKey = "24688698-e20a-4f0d-9c96-60386006d5aa"
    var trackingKey = "17998b62-c25d-4147-9cf3-d2921dab03e7"

    // PRODUCT ID
    // var dataLayer = window.dataLayer || [];
    var productId = '388';

    //checkVideoAvailability
    SDK.checkVideoAvailability(playerKey, productId, function (value) {
        var divPlayer = document.createElement("div");
        divPlayer.setAttribute("id", "playerTeester");

        var player = SDK.init({
            type: 'player',
            args: {
                key: playerKey,
                product: productId,
                width: '100%',
                height: 'inherit'
            }
        }, divPlayer);

        document.querySelector('#tab-description').append(divPlayer);

    });

    var trackProduct = SDK.init({
        type: 'tracking',
        args: {
            key: trackingKey,
            product: productId,
            event: 'PRODUCT_PAGE_VIEW'
        }
    });
});