I am looking to create a unique http link to an external URL, extracted from my JSON data, within the detail pages of my app.
Currently, I have the inappbrowser plugin installed that functions with a static URL directing to apple.com. However, I would like to utilize a product-specific link URL from my JSON data. You can find the JSON data here, specifically the "aw_deep_link" that I intend to use.
How can I incorporate a link to an external URL retrieved from an Angular expression using my Buy Button on the detail page and then add Google Analytics tracking code to the end of the URL?
Below is the Google Tracking Code that should be added:
?utm_source=app&utm_medium=android
Here is the Plunker example, currently set up with a static URL on the detail pages.
DETAIL.TS
openUrl() {
this.platform.ready().then(() => {
let browser = new InAppBrowser("http://www.apple.com",'_blank');
// let browser = new InAppBrowser("www.apple.com$?utm_source=app&utm_medium=android",'_blank');
// let browser = new InAppBrowser("{data.aw_deep_link}",'_blank');
});
}
DETAIL.HTML
<button (click)="openUrl()" ion-item>Buy Now</button>
A similar approach was used for Twitter pages in the Ionic Conference App