Hotjar survey via javascript trigger with Google Tag manager not loading on first history change - reactjs

I have a sharetribe react application which has google tag manager implemented.
Have added the Google Tag Manager tag below to be triggered on all history changes.
hj('trigger', 'listing_upload_canceled')
When When I test it out on Tag Manager Preview, I and change the page on my single page application I can see that the tag is fired successfully, but the hj survey doesn't load.
When I click on the same navigation option and a second history event occurs the survey will load. When I load refresh the page entirely as well the survey will load. It seems to be ignoring the first pushstate history change when I visit any path of my react app but will load the survey on the second pushstate history change.

Related

Firebase Analytics (screen view tracking) only working when refreshing the page

Hello guys I need help I'm using firebase analytics in a Next JS app and it seems that page view/screen tracking only works whenever I refresh the page. When I click the links that will change routes, it doesnt track the changes in screen view. I wonder why this is happening? Here is my code how I setup the analytics.
enter image description here

Page Doesn't exist error for lightning page in salesforce

I have created a lightning web component and added this on the detail page of the account as quick action. As I need to open new page with that lwc component on click on that quick action so I created a lightning page through lightning app builder and added created lwc component there.
In the lwc component I am simply fetching data from one custom object and showing that. When I login with one of the salesforce profile then it's showing error Page doesn't exist.
I have debugged and found that the lightning page's tab's visibility is hidden and it's not showing through quick action. If I change visibility to default off then it's started working.
Can anyone please suggest me what I am doing wrong here. Any help will be appriciated.
Thanks

Facebook pixel setup via GTM on a SPA(React) fires page view event twice

So like the title says, I'm using Google Tag Manager to send events to Facebook. Most events seem fine any only fire once, except the view page event. The event is setup to trigger using GTM's history trigger because we're using React for our site.
Originally it was setup to fire on all history changes, but I notice when using preview mode in GTM that there were two history changes being fired.
1: gtm.historyChange
2: gtm.history change-v2
So, I updated the trigger to only fire on some changes and set: Event equals gtm.historyChange With this change I now only see one history change in GTM preview mode, but I still see two in the fb pixel helper chrome extension. One Page event has the an event ID and params I want to see, the other has nothing.
I'm no analytics or pixel expert so even pointing to a possible reason why this is happening would be really helpful.
I believe that the Facebook pixel already considers history change as a page view, so you are double counting it by also triggering it on the history change. Just load it on page view only and it should resolve the issue.

adding history to browser from angularjs

I am using angularjs and ui-router. I have a page where i search certain content and show/hide some sections. I want to add history to browser, so that when user clicks on back. He can go to previous page where he was. How do i handle this requirement.

Prevent AngularJs reload on direct inner page view

For example
In my angular website I have 2 pages called /app , /app/users
If someone visits /app page it displays app.html content
i) When user navigate from /app page to /app/users page angular is fetching users.html and displays inside /app.html 's ui-view.
ii) But if user visits /app/users page directly then my server routing this into users-full-page.html page which have both app.html and users.html codes. Also it have same AngularJs functionality. (Am doing this for SEO purpose)
Now the problem is, In my second case when user visit directly into /app/users page after the page load Angular reloading the users.html content again which already loaded directly from server
So how to prevent this?
Note
Actually I don't have error or problem on Angular code anywhere to show. It's working. I want to prevent one of its feature. When user navigate /app/users page it loading users.html content without problem. But when user visits /app/users page directly I already loaded users.html content in server side itself. So I don't want angular to load it again. So I need to prevent

Resources