Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Implementing Adobe Analytics for an Ionic Capacitor Hybrid App

Avatar

Level 2

Hello,

 

My team is working on discovering how we can implement Adobe Analytics into our hybrid Ionic-Angular with Capacitor application.

Ionic Capacitor version 6.18.1.

Angular version 13.0.4

 

We started to explore using the Mobile SDK (through the Experience Platform SDK) following the steps for Cordova. However, our main issue arrives when the time comes to add the initialization code (see step 2 here). 

 

While we do have an AppDelegate.swift file for the created iOS platform, we do not have a MainApplication.java file for the Android platform. So, we cannot add the required initialization code for Android.

We do, however, have a MainActivity file beneath this file structure android\app\src\main\java\io\ionic\starter\MainActivity.java.

 

No source code is written specifically to these platform files for this application.

 

Is there a way to add initialization code to the Android platform that is provided by Ionic? If not, is it better that we go down the route of using the 2.0 APIs to track events? Or possibly go down the route of using the JavaScript implementation with AppMeasurement.js?

 

Any advice or expertise would be greatly appreciated!

 

Thank you,

Corrinne

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Ok, sorry I couldn't help you more... in the meantime, because this is a bit of a non-standard implementation, I would recommend making sure you do a lot of extra in-depth testing to ensure that everything is tracking as expected.... 

 

I would hate for you to find out a few months in that something is missing, or double counting, etc 🙂

 

And believe me, we have our fair share of custom implementations that had to take several iterations to work out the kinks.

View solution in original post

4 Replies

Avatar

Community Advisor

Hi,

 

While I am not a mobile app developer (and our apps are written in React Native, so I don't know if our team would have insights into Ionic Capacitor), I did find this post from a few years ago: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-cloud-mobile/ionic-mobile-app-inte...

 

Not sure if the steps here might shed some insights into implementation.

 

I did a quick search on Ionic, and I see that it has integrations with other frameworks... do you know if there is an underlying framework that might have an implementation instruction that can be used? (https://aep-sdks.gitbook.io/docs/using-mobile-extensions/adobe-analytics

 

My concern with trying to create a custom solution (either through the API or trying to use web code for this purpose) is the potential to miss app specific tracking (such as app lifecycle metrics - launches, crashes, upgrades, days since last upgrade, etc - items which have no equivalent in the web experience)

 

Good luck, and I can continue to attempt some meager support.....

Avatar

Level 2

Hi Jennifer,

 

Thank you for your response.

 

Our team has moved forward with using web code (AppMeasurement.js) to track actions. If lifecycle hooks become a big ask, we may have to continue researching methods to capture them. For now, the web code allows us to track in-app searches, which was our need for the time being.

 

Unfortunately, installing the Mobile SDK and Adobe Analytics extension does not seem to have a route that does not involve adding native iOS and Android code, which is where our major blocker is with Ionic.

 

Cordova is the closest implementation route we could begin to follow, but again we run into this blocker when registering with the Mobile SDK.

https://aep-sdks.gitbook.io/docs/using-mobile-extensions/adobe-analytics#register-analytics-with-mob...

 

Thank you again for your suggestions and time!

-Corrinne

 

Avatar

Correct answer by
Community Advisor

Ok, sorry I couldn't help you more... in the meantime, because this is a bit of a non-standard implementation, I would recommend making sure you do a lot of extra in-depth testing to ensure that everything is tracking as expected.... 

 

I would hate for you to find out a few months in that something is missing, or double counting, etc 🙂

 

And believe me, we have our fair share of custom implementations that had to take several iterations to work out the kinks.

Avatar

Level 2

I appreciate the guidance!

 

So far testing has gone well - events and eVars are capturing data as anticipated. However, I'll be sure to do extra review for double counts, especially page views.

 

Thank you again,

Corrinne