gtag.js tracking on multiple domains but no linking - analytics

My company has an angular component library that we want to track usage of. This means that multiple developers will us it on multiple domains. I have included a single tracking id and am dynamically loading the gtag.js library when components are loaded. This works on the main domain but the tracking isn't logged in the dashboard. Does anyone know of the settings required to make this possible? Also I am not trying to link any pages or sessions, just have unique tracking per application.

It turns out that I had upgraded one gtag emit call but a second one was still in the ga syntax and wasn't registering in the dashboard.

Related

When do Tealium vendor tags fire on React pages?

We've implemented Tealium throughout our site, including some newer, single page app (SPA) content. Our devs are new to Tealium, so we're all kind of building the car as we drive it.
I've read Tealium's docs on both single page apps and the standard order of operations. What I don't fully understand is when vendor tags fire on SPA sections. For example, when I first land on a SPA page, I see the HTTP requests indicating the tags have fired (We haven't disabled the initial page view event yet). But as I navigate around that app, triggering the manual link/view events that the devs implemented in the site code, I see those events being logged but the HTTP requests from vendor tags are inconsistent or not-existent. For example, we have a Google Ads tag that appears to fire with each of these events, but we also have Microsoft Ads tag that does not, despite both tags' Load Rules being configured to load on all pages.
Can anyone confirm whether utag.view() and utag.link() fire vendor tags when called? If I'm misunderstanding a piece of the implementation, I'd be grateful for a clarification. Thank you :)
As a general rule, Tealium knows nothing about your app's events. Like most tag managers, it'll default to firing off a utag.view() indicating a new pageview once the page has loaded, but in an SPA app, that happens once and it's got no hook into your router to understand future navigations.
Rather, it's on you to instrument your SPA and augment the router so that when a new route is successfully rendered, you call a utag.view() and when other actions occur that you want to track, you make the appropriate utag.link() calls as Tealium will not do this for you.

Using abp-page-toolbar and abp-extensible-table

I am trying to use both components in my angular application. I am a backend developper and absolutely newbie in angular. I have been reading the roles and users components in the source code and I think I cloned it for my Customers component. I have guards, defaults and all the code like Roles and Users but, although the code compiles and the API call is done, I have nothing in the screen, only the Total records are displayed. No action buttons, no table rows, no pagination...
Is there anyone who has use these components and can bring me some help?
Many thanks
Those components are needed for customizing built-in modules. Let's talk about Users for example. The Users component is a built-in page and you do not have access to its code. However, you may still need to make some changes like adding a New User button on the toolbar or changing its columns, form fields etc. That's why ABP Framework provides some injection tokens to override/extend/customize these features. Since you are developing your own page, you do not need any of this. You can directly use ngx-datatable in your own component, add or remove columns and so on.

SPA - When to use Location Based or Internal State?

Hopefully this is not too opinionated but I am wondering if there are best practices regarding location-based SPAs and Internal based SPAs.
Internal based SPAs - track state internally
Location-based SPAs - URL location / Sessions , etc
In one part of my site if a user pastes in the url the search results will show.
However if I should be doing it for areas like admin section.
For instance I am allow users to add inventory to this point
admin -> add new Inventory -> choose center -> choose subcategory -> add inventory.
This is pretty much the flow, however if I would make it location based then on the "add inventory page" I would have to set the
company
center
subcategory
Which would require ajax requests to get all the data and basically every page I would have to do setting up data. It just seems like alot of work that every page has to be fully setup if they are coming from a url.
I am already using stuff like react-router to do my routing but in the end of the day I would to make sure that everything is always setup to the page can basically run standalone.
So maybe in some situations it would be better to somehow just redirect users back to the root of everything instead?
I would recommend using React Context for resolving your problem.
Once authorized, you can set the Provider value to be the user or their permissions, then on each ComponentDidMount or render() or whatever lifecycle hook you choose, you can check the users permissions and then allow the functionalities based on that.
Context values persist throughout routing, so you won't have to worry about updating it all the time (although you probably should if your user has a timed session).
So it is fully possible and probably more effective to use a mix of both internal and location based state management.

Lazy load angular modules on demand and with permission

Take a SaaS company that wants to pack all its services into a single, uhm.. Single Page Application using Angular (1). Now there is a public area (landing page, etc.) and an internal area. There are various layers of protection in the backend. There are different user groups with different privileges.
If the complete app is compiled into a single javascript file, hints for all routes can be found in the JS file quite easily. Then, there are services / $resources for interacting with the API, which again contain quite essential information on the functionality of the application.
Now the question: How could someone put modules on a certain non-binary protection level, and only load this particular module when the user is authorized to see it, all while not reloading the page?
I can find a way to lazily add modules to an angular application. I can also protect single files server sided and only send them to authorized users. But that seems like an unscalable hassle when there are more and more user groups.
Do you know any generic libraries for that purpose, ideally in sync with koa, which do not create a vast overhead? Do you know of some grunt / gulp / whatever processes, which help with that?
Thanks!
You can use latest ui.router which allows you to lazy load routes.
https://ui-router.github.io/ng1/docs/latest/interfaces/state.statedeclaration.html#lazyload
Also you can use web pack and use multiple entry points to create seperate bundles. https://webpack.github.io/docs/multiple-entry-points.html
By following above steps you can optimise the app but I don't think that this will add any protection to the web assets. You can minify to make life bit difficult to understand what your JS code is doing.

Piwik, Export count of page visits for a specific url

I Make artificial page views with javascript on my website using javascript, because I need to track them later
piwikTracker.trackPageView('/lid/902095/website');
I need to be able to export how many times the above code was executed, i.e. how many times /lid/902095/website was visited, so that I can show some stats on my website, however I'm not sure what my query to the API should be, here is my attempt:
?module=API&method=Actions.getExitPageUrls&idSite=2&period=day&date=today&format=JSON&token_auth=anonymous&segment=pageUrl=#%2Flid%2F902095%2Fwebsite
It returns an error at this time "Error: The report 'VisitsSummary_CoreMetrics' was requested but it is not available at this stage. You may also disable the related plugin to avoid this error."
I don't see a plugin with that name in plugins section, my active plugins are "Actions, Dashbord, DoNotTrack, ExampleAPI, ExamplePlugin, Live, Login, Widgetize"
Not sure if this is the right query to send to the API or not, any help is appreciated.
If you want to track the visits use this api call
?module=API&method=VisitsSummary.getVisits&idSite=2&period=day&date=today&format=json&token_auth=anonymous
by default VisitsSummary plugin is provided
Piwik Web Essentials is a good book for reference.

Resources