Testing Google Analytics iOS SDK - iphone

Has anyone found a good way to test Google Analytics on iOS? The SDK is really simple but the docs do not discuss how to test or validate.
Does the library behave differently on the simulator or when running a debug build config?
I setup a delegate GANTrackerDelegate with this delegate method:
- (void)trackerDispatchDidComplete:(GANTracker *)tracker
eventsDispatched:(NSUInteger)eventsDispatched
eventsFailedDispatch:(NSUInteger)eventsFailedDispatch;
That method gets called just fine and I see positive values in eventsDispatched and eventsFailedDispatch has always been 0. Beyond that is there a way I can test that those events are being received correctly and correlate with what I think I'm submitting?
I'm thinking I need to setup a dedicated GA Website profile for test. Run a fixed set of UI automation unit tests and then wait 24 hours for that data to be available and validate "by hand". Ick.

Now it's a lot easier with realtime analytics, you see the visit in realtime, and it's working on the simulator :
https://www.google.com/analytics/web/#realtime

Why not just test the lib separately? Write a simple class and make as many calls as you want. This won't involve any UI automation so should be easy to implement.

Mobile Analytics: An End-to-End Walkthrough has a section "Finding Data in the Analytics Web Interface" that says,
Bear in mind that it can take the analytics front-end up to 24 hours to process newly collected data.
So it looks like setting up a dedicated GA Website profile for test and performing scripted UI tests is probably your best bet.

Related

Dynamically Change API Environments Google Rollout Track

I'm developing an Ionic(3 / 4)(Angular 4 - 7)-Cordova / Capacitor Cross Platform Application(s). I'm interested in switching API env based on the current rollout track in the Google Play Store. For example, once an application has been successfully tested and recommended to continue staging/production. I would like to have the API env dynamically changed (e.g., using a different URI domain to connect to REST API ) dependent on the Google Play Store Track.
I'm aware that I can use Google Developer Play Store API to identify / list versions and available tracks yet, I'm unaware if there's already an implementation or solution. I'm perfectly willing to design a solution though, I figure I find out if it's been done already rather than reinvent the wheel.
I'm hoping to implement a solution either to the REST API BACKEND or in the ionic framework layer rather than an integration at the native layer for scalability per-project. The purpose of doing this would enable CI rather than rebuilding the project and change the API URI domain for every environment. Any assistance in this matter would be greatly appreciated.
So, if anyone's interested. The approach highlighted above is possible, couldn't get an answer so I just created something. Using Google Play Developer API. The process flow is as follows:
[]
For now it's a working prototype perhaps its not very efficient; I suppose it can be improved if the request was issued from a single server, or microservice. Though, I wanted to make the code recyclable and it's isolated from both the mobile application & Node Server.
If you are interested in learning more or would like to work on project. Please feel free to contact me.

How to build web interface for my Swift App/Firebase

I learned how to code in swift a little while back and created my first app. Now I'm trying to market it to customers, I realized that a web-interface might be what I need to scale this up to start attracting clients.
I use firebase as my backend now and would like to see what I can do to have a web interface that:
Allows customers to log in to see their unique data.
Updates info on my firebase backend
is Scaleable.
I'm not sure where to start nor how long this process will take. Any one has any ideas on where to get started?
I'm pretty sure Wordpress has a firebase plugin that could come in handy. Using Wordpress would save a lot of time actually designing a website, getting servers, and backend stuff like that. If you pay a little bit you can get rid of the .wordpress. com tag too, and your website can easily look professional.
Firebase is a realtime database and it is mostly used with mobile apps and some of the JavaScript applications like Angular and ReactJS. I think the best is to use ReactJS and there you can do a lot of the same functionalities you did on your app.
You can find a lot of tutorials online about how to do reactjs and firebase apps.
Have a look at this post and it should give you an idea about how it is done. It is gonna be a new thing if you are not familiar with javascript NodeJS / ReactJS development. (Firebase, react and redux wait for store to update)

Best practices designing sandbox for REST api

We are developing some REST api's for internal use. To test these microservices we are toying with the idea that every service has a sandbox mode so we can do integration tests that are as close as possible to the real deal.
To see if this path is worth trying we are looking for documentation / best practices on how to manage this sandbox and how to implement this internally. When we look for the keywords Sandbox, REST API and Best Practices we only find how to implement as consumer of existing sandboxes.
So does anyone have some documentation / links in how to tackle this problem and what the pro's and con's are of the different ways?
Kr,
Thomas
I'd say there are two ways to proceed:
Basic: keep a separate sandbox instance of a service. You always deploy a new code to this instance first and run automated/manual tests to verify if everything works fine. A datastore could be a snapshot from the production data or artificial testing data. I would rather we have a "Snapshot" but it depends whether it is applicable in your particular case (privacy etc.)
Advanced: I spied this technique on Facebook Marketing API. This API provides an interface to set up and launch advertising campaigns. They didn't provide a sandbox api for testing purposes (at least last year when the system I was working on had been integrating with Facebook). However if you use a keyword "test" in a name of a campaign or an adset (key entities in the ad world) they would never launch and spend your money. You can try extend this concept on your particular domain and run tests on (or very close to) your production
Hope this helps

Can Coded UI Tests Be Used with External Sites?

I'm trying to figure out a way to automate testing for Single Sign On (SSO).
For us the process is as follows:
The user logs onto https://www.identityprovider.com
They click a link that takes them to our authentication server (the application that we are testing).
They are automatically logged into one of our web application (www.serviceprovider.com).
Writing useful unit tests for this seems to be difficult because of the protocols used for SSO (SAML, OAuth), and so I thought that a good way to do the testing would be via recorded step testing through something like MS Coded UI tests or Selenium. We would prefer to go with MS Coded UI tests because of the integration with the VS solution.
That said, can anyone tell me if I can start my CodedUI test from an external website (for example: google.com), or am I limited to my local solution?
You are able to hand code that.
BrowserWindow bw = BrowserWindow.Launch(new System.Uri("http://google.com""));

What is the best way to do web scraping from an iPhone App?

I am writing an iphone app and I need to scrape about 50+ websites for data.
Does anyone know of any good client-side solutions that I can use ? I dont want to build a backend just for this.
Any pointers ?
Thanks
Rohan
Looks like your primary focus is the mobile application, and you want to offload the scraping activity to an outside service.
Use a service such as Bobik ( http://usebobik.com ) that provides APIs for scraping data off websites. You can even test your queries for free!
The API is fairly extensive, have a look at http://usebobik.com/api/docs for more information. There's even a SDK available!
I think it is natural to build a small backend web app that takes a query from your phone and does the scraping. It's extremely easy, is not it? Scraping can be done via curl or something.
A web server these days is about 15 lines of code from the scratch.