none
UWP JavaScript App - onEngagedChanged event RRS feed

  • Question

  • Hello

    When I use this sample code from 'https://docs.microsoft.com/en-us/windows/uwp/monetize/adcontrol-in-html-5-and-javascript', 'onEngagedChanged' event is fired when ad is shown and not when is clicked as described inside 'ad.js' file from Microsoft Advertising SDK for JS

    var adDiv = document.getElementById("myAd");
    var myAdControl = new MicrosoftNSJS.Advertising.AdControl(adDiv,
    {
        applicationId: "3f83fe91-d6be-434d-a0ae-7351c5a997f1",
        adUnitId: "test",
    });
    
    myAdControl.isAutoRefreshEnabled = false;
    myAdControl.onErrorOccurred = myAdError;
    myAdControl.onAdRefreshed = myAdRefreshed;
    myAdControl.onEngagedChanged = myAdEngagedChanged;


    from 'ad.js':

            /// <field type="Function" locid="MicrosoftNSJS.Advertising.AdControl.onEngagedChanged">
            ///   When the user clicks on an ad and begins an expanded experience, this event is fired. The
            ///   app must then call isEngaged to see whether this is an engage or disengage event.
            ///   The handler function takes a single parameter which is the AdControl which fired the event.
            /// </field>
            get onEngagedChanged() { return this._onEngagedChanged; },
            set onEngagedChanged(value) {
                if (typeof (value) === "function" || value === null || typeof (value) === "undefined") {
                    this._onEngagedChanged = value;
                }
            },

    Any help is appreciated!


    Monday, August 27, 2018 3:50 PM

Answers

  • Hi p1vell,

    I encounter the same issue with you. We will consult the related team about how to fire 'onEngagedChanged' event. Could you mind adding a button to hide your ad? 

    Best Regards

    Daisy  Tian


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by p1vell Wednesday, September 5, 2018 8:05 PM
    Wednesday, September 5, 2018 8:36 AM
    Moderator

All replies

  • Hi p1vell,

    The information you provide may make us a little confused, could you describe it more clearly?

    Best regards

    Daisy  Tian


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, August 29, 2018 9:43 AM
    Moderator
  • Sorry for my late reply!

    In my app I have a banner ad. When user click on that ad I would like to hide it for this user, for the current session.

    I thought that  "onEngagedChanged" event should be fired when user click on ad, but its not working lie that.

    Monday, September 3, 2018 6:19 PM
  • Hi p1vell,

    I encounter the same issue with you. We will consult the related team about how to fire 'onEngagedChanged' event. Could you mind adding a button to hide your ad? 

    Best Regards

    Daisy  Tian


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by p1vell Wednesday, September 5, 2018 8:05 PM
    Wednesday, September 5, 2018 8:36 AM
    Moderator