Firebase / GTM: Custom Tags - firebase

In a Website GTM implementation , you have the possibility to create your own custom tags using javascript, so it's easy to set up webservice calls to your own system etc by just using the GTM interface.
Now for a Firebase - GTM implemented app, are there any possibilities like this?
I saw the functioncall option, but if I get it correct, this means you need to program some methods/functions inside your app and you can call them using GTM and there's also the option to pass some params. This is not quite the same as the website-gtm tags, which we can create on the fly in GTM.
Is there any other way , without the need to redeploy your app ?

Yeah, since we cannot inject code into an app using GTM there are no custom tags.
True, there is a Firebase function. Another option which has been used for a while in GTM SDK is an image tag.
It lets you execute server-side code on your server or use azure function as well as firebase function

I believe the advantage of GTM with mobile apps is that you can manage existing events and parameters by enabling or disabling them. When you release a version of your app that is logging a certain way you will not be able to change that and any users that have not updated to your new version will continue to log the same information.
Example:
MyApp v1.0.0
MyEvent
- my_param_id
- my_param_name
- my_param_etc
MyApp v1.0.1
MyEvent
- my_param_id (this is now the name)
- my_param_etc
Without GTM users with 1.0.0 will still be logging in the same way it was set up at the time it was released. With GTM you will be able to filter out those events with the "trigger" to not allow those events to get logged.

This has been a while, in the meantime I have been searching myself.
It seems like the best option to manipulate stuff and execute custom tags are the Cloud Functions in Firebase that can be triggered by Firebase Events.

Related

Send conversion event to Google Ads from NodeJs backend (AWS)

I have a website hosted in AWS with a NodeJS backend.
I have Google Ads conversion events being sent from the frontend using gtag.js, but I noticed missing events and a lot of duplication (even if I use transaction IDs with my events)
I has similar issues with Facebook Pixel and was able to resolve the problem by sending simple vanilla http calls from the backend.
Is it possible to do the same with Google Ads? I have not been able to find any documentation for server side APIs for Javascript.
This documentation here seems promising, but no Javascript SDK exists. That's is why I would like to know what vanilla http calls to make.
I have seen documentation about GTM server side, but it seems I need to host a GTM container (server?) which I would prefer not to have to. Unless I misunderstood what hosting a GTM container means in the context of a AWS cloud solution.
In addition to the native, gRPC-based Ads API there's also a REST alternative which can be used if there's no native client library, such as for NodeJS.
The endpoint relevant for your use case is customers.uploadClickConversions, which allows you to register a conversion given a specific click ID.
Keep in mind that you'll need to apply for API access in order to be able to use the Ads API (aside from accessing test accounts).

How can I create links of my native script app just like a web page? And listen to them?

We can perform a specific task when a URL is called in the web apps. Suppose we can send an email when a POST request just hits a .php file.
Exactly the same thing I want to do in nativescript.
So the questions are:
How can I create links of my apps?
How can I call them?
How can it perform an action when a specific URL is called from my app?
Actually I'm building a chat application which will use http calls rather than socket io or firebase value change listeners, etc.
Thanks in advance!
I think you are looking for deep linking. Use nativescript-urlhandler plugin, setup a URL scheme for your app. Then all you need is just listen to the event and perform navigation for that URL.
Apple started supporting Universal Links only from iOS 9. You will have to follow some additional steps mentioned in the Apple Docs, basically verify you own the domain.
I usually use a:
<Label onTap="clickMe">
And the function clickMe add a navigateTo native method.

Can I fire a cloud function from Firebase Hosting after the page has loaded?

I'd like to create a website hosted by Firebase Hosting, which can post/put/get data from a Firebase Database. Google's example to connect Hosting to a Database isn't very helpful to me though, because it doesn't give any indication of how to fire a cloud function AFTER the page has loaded (the example fires a cloud function whenever you go to a specific url and fires when that page loads).
The most similar SO post I could find was this one, which appears to be able to interact with a database after the page loads like I want, my difference is that I want the interaction to be server-side (I want as little information about how the data is stored as possible to be shown).
I'm thinking if I can fire a cloud function after the page has loaded (when a user hit's a save button), that cloud function can interact with the database through an API to save the information.
In my searching I couldn't find very much information about connecting Firebase like this, is this possible/logical?
It sounds like all you need to do is create an HTTP trigger, then call that from a XMLHTTPRequest or similar. You can do that whenever you want from the page that's currently showing in the browser.
Cloud Functions code don't need to be interacting with the database via a REST interface. They should just be using the Admin SDK instead, which is far easier and faster. There are a lot of official samples that illustrate this.

Server-side events tracking with GTM

I'm looking for a way to implement server-side event tracking and link it somehow with GTM. Need to say I don't have a lot of experience with both and all my experience is from developer-side.
When I worked with Google Analytics only to do server-side events tracking, I simply used Measurement Protocol they have.
But now it seems like just pushing events to GA is not enough to make GTM have any idea about this events. Or, at least, to have proper idea about the event.
But now the question is:
How should I notify GTM about events which is server-sided by nature in the right way? Is it possible it all?
As far as I understand, one can "push" data to "data layer" as they call it, but once again, this push can be done from client-side only. And I need to make it server-side.
GTM is a client-side javascript injector. It does not have a server-side component (you could download the generated Javascript file and host in on your own server, and it would still work).
Since GTM is not a tracking tool there is usually not need to run it on the server side (if you want to send data to an external tool from your server it is usually easier to cut out the middle man).
So the only way to push serverside events to GTM would be to run a client on the server, e.g. a headless browser like phantomjs. That could load a page with the GTM code and you could automate it to execute javascript functions based on input from your server side application. While technically feasible this sounds like a horrible PITA.
Update: Google has announced a closed beta for server-side tracking, where you run a container in a cloud environment that then distributes the requests. Simo Ahava has a little info in his twitter feed: https://twitter.com/SimoAhava/status/1222459714614841346. This is not yet a production feature.

How do I send Issues into BitBucket by email?

I Love BitBucket.org
But is there a way to configure BitBucket to accept email and automatically put them into my 'New' Issue list in the issue tracker?
BitBucket sends out email notifications, but I want something the other way around. I don't want to have to go in and create an issue manually each time someone emails me about a problem. I want to forward those emails to Bitbucket so problems to go directly into the issue tracker via E-Mail.
And: Similarly, can you configure Bitbucket so that it listens for code check-ins and it auto-magically set issues to complete/fixed etc.?
Is there a way?
I don't think there is a way to submit issues via email and now that Atlassian has bought Bitbucket I doubt that they will spend much time improving or enhancing the issue tracking inside Bitbucket as their main product (JIRA) is an very comprehensive issue tracker.
I would sooner expect some sort of integration of the two and a phase out of the current issue tracker. But then we will probably have to pay :-(
Re adding emails:
I want to forward those emails to Bitbucket so problems to go directly into the issue tracker via E-Mail.
Yes you can do this - you need to have an endpoint that receives emails, so for example sendgrid allows this (see Sendgrid webhooks docs), and will call a webhook on your server whenever an email comes in. You then need a bit of glue code on the server to post that issue to bitbucket via the bitbucket API (see the bitbucket api docs). So there are two parts to doing this, and you will need to write some code I think.
I'm currently working on a tool to do just this at Project Page. If anyone would like to try it out let me know. I'm also planning to let it interrogate the user to get a bit more detail about things like priority and urls associated with the problem.
Re the second part of your question:
Similarly, can you configure Bitbucket so that it listens for code check-ins and it auto-magically set issues to complete/fixed etc.?
Yes you can close issues automatically - just use the text fixes #n, so for example:
fixes #123
in the commit message, where 123 is the number of the issue you want to close.
There is a API to create issue http://confluence.atlassian.com/display/BBDEV/Issues.
And a custom script which may or could be able to fetch email and post to issue tracker.
Yes, it's possible. Bitbucket has a robust REST API that lets you do it at least two ways:
Option 1: 3rd Party Service
Use an online API automation service like
Zapier or
Integromat
(Click those links for specific email/Bitbucket integration examples.)
You have a couple of options with this approach. With Zapier, for example, you can have a dedicated Issue-only Gmail address, and any email sent to it creates a new Issues ticket. OR you can automatically create Issues just by assigning a specific label to an email in an existing Gmail account.
Oddly, IFTTT doesn't currently offer Bitbucket integration.
Option 2: Write Your Own Server Script
If you have server access, you can configure your Message Transfer Agent to send certain emails to a PHP script that will create a Bitbucket Issue.
The script will need to use the Bitbucket API repositories > {username} > {repo_slug} > issues > POST method.
A great how-to article for this approach is Process Incoming Mail with PHP Script with Exim.

Resources