What is the difference between #nuxtjs/google-gtag #nuxtjs/gtm #nuxtjs/google-analytics and vue-gtag, what to use for GA4? - vue.js

Newbie to this whole analytics thing and am finding this very confusing
I wanted to use Google Analytics 4 in my nuxt ssr webapp and am feeling overwhelmed with the number of options
Quick issue on nuxtjs/google-analytics says it does not support GA4 and is asking me to use nuxt/gtm
stackoverflow answer on the same question says use vue-gtag
Google's documentation says it covers analytics ads etc
nuxt/google-gtag seems to be another library apart from vue-gtag and nuxt/gtm
what am I even supposed to use?
I just want to integrate Google Analytics 4 on my nuxt.js SSR app

Create a GA account and a GA4 property if you have not already. Keep a note of your Measurement Id (the "G-" Id). The same page can help you to find the id.
Use nuxtjs/google-gtag. Page includes setup help.
When passing the config in your code, use this format:
// example config
'google-gtag':{
id: 'G-XXXXXXXX', // your measurement id
... // rest of the config
}
Just to compare, for Universal Analytics (the previous version of GA), the Id would look like UA-XXXX-XX, instead of G-XXXXXXXX. Learn more with Google Analytics 4 properties tag and instrumentation guide.

Related

Is it possible to get lastUser for a DHIS2 analytics API call?

We're running a nodeJS script to identify erroneous data values (negative numbers) and we're unable to determine which user captured the values without logging in and inspecting the data entry form.
There doesn't seem to be any documentation for including user identification data in the analytics API end point.
Has anyone figured this out yet?
many APIs are present in dhis2 documentation including these :
/api/33/dataValueSets
/api/33/dataValues
But a more suitable API for this case would be the AUDIT API:
/api/33/audits/dataValue
A detailed documentation is visible at this link :
https://docs.dhis2.org/en/develop/using-the-api/dhis-core-version-235/web-api.html#webapi_auditing_aggregate_audits

How to start ArangoDB-GraphQL-Express?

I looked at the support from ArangoDB, and google search, but it did not help me much...I am fresh in these topic, (but Polish proverb says that you should not be ashamed to ask questions).
my situation is as follows, I have quite a very extensive database, which I created by GUI-HTTP-ArangoDB (by importing further crafted JSONs, as collections of Verexs & Edges) I would like to link this database and dynamically depending on the query, display the resutat, only hmm I do not know how to connect it. is like a tutorial on the arango page to Node, but there is nothing to write like where and what to create, just they only described the next command that do something .. ech ...
I am looking for examples, or a step-by-step guide/tutorial..
I am asking you for help / support..
how in it, to find himself..
Well, there are two options I would use to connect Arango to GraphQL:
1 Use the Foxx micro services that live within Arango to create a Rest API. Then you can use wrap the Rest api in GraphQL. Here is the tutorial for creating the Foxx micro services :
https://docs.arangodb.com/3.3/Manual/Foxx/GettingStarted.html
And here is the tutorial to wrap the the rest api in GraphQL:
https://www.prisma.io/blog/how-to-wrap-a-rest-api-with-graphql-8bf3fb17547d/
2 Have the GraphQL Server be part of the Foxx microservices instead of the Rest Api as described here
https://docs.arangodb.com/3.3/Manual/Foxx/GraphQL.html
And here
https://mikewilliamson.wordpress.com/2017/03/24/arangodb-and-graphql/
Hope this helps!

Twitter API oAUTH

I have implemented twitter API (oAUTH) by going through this tutorial http://net.tutsplus.com/tutorials/php/how-to-authenticate-users-with-twitter-oauth/ . Its working and I can update my status (which I am guessing its kinda sharing) . The problem I am facing now is how can I add pictures , few words and a link to this $twitteroauth->post('statuses/update', array('status' => 'Hello Nettuts+'));. Something like twitter cards.
Is there another good tutorial which explains and demonstarte all the functions of Twitter API (oAUTH).
Thanks. :)
You can include a link/URL in your status update in the same way that you have included the other words (Hello Nettuts+).
However, you cannot add pictures in this manner - you will need to use the statuses/update_with_media endpoint as opposed to the statuses/update endpoint that you are using in your existing code. You can learn more about how to do this by reading Twitter's API documentation:
https://dev.twitter.com/docs/api/1.1/post/statuses/update_with_media
And you can see some example code here:
https://dev.twitter.com/discussions/1059

Spotify API get Related Artists

Is there a way to get a list of related artists through the spotify api. Like the small list that displays in the actual program?
Would be very useful if so, but I am not so sure
Cheers
Yes, it's available through libspotify. There's a SPArtistBrowse class that contains a lot of metadata, including the related artists. Check out the
CocoaLibSpotify comes with a documentation package, where you can find more details on what's included: https://github.com/spotify/cocoalibspotify.
Do note that it's currently extremely slow to load an entire SPArtistBrowse object. I'm assuming it's got something to do with libspotify loading it all in one chunk and on the main thread (?). From what I know, Spotify are suppose to remedy that in an upcoming version of libspotify, though.
Get an artist's related artists is now available through the Spotify Web API.
GET https://api.spotify.com/v1/artists/{id}/related-artists is the format.
https://api.spotify.com/v1/artists/43ZHCT0cAZBISjO8DG9PnE/related-artists is an example request.
For more information, see the API documentation.
There is also a JSFiddle demo app.
Definitely! All you need is the "artist_id" and the SpotifyPublicAPI can return a list of the related artists. You don't need an access_token at all.
You can easily test the API call here on RapidAPI. I've specifically linked you to the getArtistsRelatedArtists endpoint. Rapid will provide you with a code snippet you can copy and paste directly into your code to make the call.
Here is an example testing the API call using Beyonce's artist_id:
Here is a sample code snippet provided by RapidAPI wth Beyonce's artist_id passed as a parameter:

REST API for driving distance?

Is there a service that will give me the driving distance between two addresses? Apparently Google Maps API requires you to display a map, which I don't want to do (on that particular page), and I'd like to just snag the data and save it to my DB after a user submits a form, rather than waiting for JS to do it's thing.
If it's relevant, this is going into a Django app. I discovered that CloudMade offers a Python API, which is nice, except their latest dev release has a bug in it (can't use the API object), but more importantly, it's support for Canada is awful (couldn't find directions from any major city around here!).
MapQuest's Directions API is HTTP Querystring based (I'm not sure if it's entirely RESTful). Can get XML or JSON response. Just need to send it an HTTP GET Request.
http://developer.mapquest.com/web/products/open/directions-service
Use the "distance" response parameter.
I don't have a high enough reputation on SO to comment on an answer but I just wanted to be clear that contrary to the voted correct answer, Google Directions API has to adhere to the Google Maps API. If you scroll down the supplied link, you will see:
Note: the Directions API may only be used in conjunction with displaying results on a Google map; using Directions data without displaying a map for which directions data was requested is prohibited. Additionally, calculation of directions generates copyrights and warnings which must be displayed to the user in some fashion. For complete details on allowed usage, consult the Maps API Terms of Service License Restrictions.
Would it be possible to use Google Maps GDirections object? This can return the textual directions instead of the map overlay if called with a div object. From there you can use the getDistance (or getDuration) functions. You can always use an invisible div for the returns if you don't want anything to be displayed on the page.
Start here
http://code.google.com/apis/maps/documentation/examples/directions-advanced.html
http://code.google.com/apis/maps/documentation/reference.html#GDirections
And use this sample code
var map;
var directionsPanel;
var directions;
function initialize() {
directionsPanel = document.getElementById("route");
directions = new GDirections(null, directionsPanel);
GEvent.addListener(directions , "load", onGDirectionsLoad);
directions.load("from: 500 Memorial Drive, Cambridge, MA to: 4 Yawkey Way, Boston, MA 02215 (Fenway Park)");
}
function onGDirectionsLoad(){
alert(directions.getDistance().html);
}
Here is my solution:
Signup for Mapquest Developer network.
Get AppId
Open your command shell and run the following command(or use fiddler) But running it through curl will give you flexibility to automate your request
curl -X POST -H "Content-Type: application/json" -d '{locations: ["Salt Lake City, UT","Ogden, UT",],options: {allToAll: false}}' http://www.mapquestapi.com/directions/v2/routematrix?key=YOURKEYGOESHERE >> distance.txt
Save above command with all your destinations into batch or sh file.
Now grep and parse out your distance.txt file for what you need.
There are free services out there, but the quality of the data may be questionable/non-existent in areas. Be aware of licences on the data too, storing in your own DB may be a breach.
http://openrouteservice.org/
Take a look at Navteq. I used their service in developing a driving directions application about 5 years ago, and got good results. Can't speak for them lately though. I believe the best URL is Navteq Routing Service
You can use the new Google Directions API directly, without using any javascript.
http://code.google.com/apis/maps/documentation/directions/