In an attempt to automate some web/browser tasks with golang I reached a barrier when if comes comes to click, touch and swipe interaction.
Thanks to the amazing https://github.com/PuerkitoBio/goquery library I am able to parse webpages and I am able to interact with form sheets.
One integral part that is missing to automate pates is simulating mouse clicks that trigger javascript.
How would it be possible to implement this in golang? Do I need to simulate OS level mouse clicks or do browsers have an API that I can use?
You would need to use something like Selenium's WebDriver which has at least one go client
Related
I work on a one single page application (360 virtual visit) with Angular 11. I would like to track user events and especially on buttons.
I started to put the Global site tag in my Index.html file like this: Global Site tag in Index.html
On google analytic, I receive connection data user First Data User
But I have no idea how I can track bouton click with Angular.
Does anyone have an idea that works today ?
do not hesitate to ask me questions for more information. :D
Thank you in advance for your answers. I would share my progress.
For something like Button Clicks, you have to configure custom events in Google Analytics and push that custom event whenever user clicks the button.
You can create onButtonClick() function and call it when user clicks the button. In the function, you should push event to the window.dataLayer:
onButtonClick() {
window.dataLayer.push({
event: 'button_click',
data: {
user: this.current_user._id,
... // Send some custom data that you want to track
}
})
}
You should be careful with SPA when you install gtag the way it is described into docs as it will track page views incorrect. In SPA browser loads the page only once, and all other actions will rerender the content but it still will not be counted as a views.
Instead you will need to set up router events. Here is a great tutorial for that. It also will explain how to set up other events like button clicks.
By the way in the example above they suggest to send user id with event. Instead of it you may send it with config only once, and it will be automatically added to any your event:
gtag('config', 'GA-ID', {
page_path: event.urlAfterRedirects,
user_id: this.user.id
});
You need to configure the Google tag manager to send events to Google Analytics. I've written a post about it: https://pieterjandeclippel.medium.com/angular-or-react-or-whatever-and-google-analytics-97342c909e61
Now it seems that Universal analytics will be on its way out, so you might want to try GA4 instead.
But I haven't tried with that one yet, since my own website has been configured to use UA.
We've added the same feature recently and this guide here, albeit a bit dated, explains it quite well.
It boils down to you using a dedicated GoogleAnalyticsService that enables you track specific events (ie. button clicks, scroll events, etc).
Now I'm developing windows phone 8.1 app with WinRT
I'm trying to support swipe-right-to-go-back gesture in my app.
I try to capture the manipulation events on my page. My page's root is a grid and have a ListView inside. I used the UIElement.AddHandler method with "handledEventsToo=true" to add the event handlers. But when I touch the screen, only the ManipulationStarting event is fired, other events seems to be eat by listview.
Could anyone tell me about the manipulation event behavior or other methods to implement this feature? Thanks!!
You won't normally capture events on LisView, beacause it has a ScrollViewer which intercepts them.
There is a way to do it - you will have to disable ScrollViewer and then perfrom some actions when the events are fired and perform scrolling manually. This answer will guide you.
In case someone encounters this page, I spent the better part of a week figuring out why manipulation events were only firing half the time on my UWP charts using the winRT xaml toolkit.
You may need to check that the background is not null on whatever element has the event handler attached. Templated controls are not necessarily hit test visible unless they have one. Otherwise, the input can go right through to the element behind it.
https://msdn.microsoft.com/en-us/windows/uwp/xaml-platform/events-and-routed-events-overview
Is it possible to add an event directly to a user's calendar (be it google, iCal, Outlook) with AS3? I work at a major network and my boss wants to add this functionality to our Flash banners to help promote our TV shows. The best I can think of is having a button that links out to a .ics file the the user downloads and adds manually, but I'd like to avoid having the user do anything other than click on a button.
Any advice/direction is much appreciated. Thanks!
You would need to develop some kind of mediator that takes your request and then translates it into platform specific API calls (if any exist). For example, you would need to use the Google Calendar API to add events directly into a Google Calendar.
I'm developing an app that needs to generate mouse events on a window Win32/WPF which may be minimized or hidden from view on the desktop.
I have tried the user32.dll APIs SendInput, SendMessage, PostMessage etc. These work only if the window is visible on the desktop. Would you know about any methods that work for hidden/inactive windows?
I've also tried .NET's UI Automation library. In this case, a window is brought to the front or I'm not able to get a clickable point for the control.
Any ideas how I can proceed? If I can proceed?
I don't know if you're still interested in an answer (I just stumbled upon this question out of sheer dumb luck), but have you tried making a global windows hook?
I have no honest idea on how to properly go about implementing one; but I know you should be able to add a global windows hook to, well, Windows, to listen for whatever events you want (should include mouse and keyboard events!)
Good luck...
I'm mainly an AS3 coder and I know Java fair enough to be able to build my own ANE files for Vibration, Toast, dialogs and that simple stuff...
using air native extensions are cool but I'm getting a bit disappointed not being able to create a simple button with it.
I know creating a simple native button is a silly thing to do as it is very easy to create buttons in air directly but I'm using it as an example.
So the question is that is it possible to create .ane for calling native Button in android? at all?
it seems like I can't create any .ane files rather than abstract tools like push notifications or popup like windows like progress bars and dialog boxes.
is it right to say that a simple native button cannot be created with air native extensions?
for those who wondering why a simple button cannot be called with extensions, read http://adobe.com/devnet/air/articles/extending-air.html (scroll down to Limitations) where it says: Extensions cannot directly integrate interactive objects, such as native UI controls, with the display list. (Other items, such as native dialog boxes, may work, depending on the platform.)