Google Analytic tracking individual page on User Flow - php

I am having an OpenCart website and I already had Google tracking already. Page views/session tracking runs well without problem. However when I come to "User FLow" from "Behavior" tab in Google Analytic menu, I can only see sessions/views of only /index.php page, not for other pages. What if I want to see how many sessions/pageviews on other specific pages (contact page / product A / product B page?
For example, I have a page which have a link like this: http://..../onlinestore/index.php?route=product/category&path=120
I want to track how many users come to this page or even how many users click on the link which leads to this page, either is ok.
Since Opencart using mvc and routing mechanism or something like that, i cannot track using normal way. I have another html website which I can track specific page easilly by having the tracking code on each individual page. But not on this php page.
Thank you very much.

Related

AMP pages server by Google on checkout

I have a big problem with product amp pages when the page is served by google cache.
The user can add the product to the basket with a call like this:
action-xhr="https://sample.com/index.php?route=checkout/cart/add".
The backend is Opencart(php), and the product added to cart, no problem, but when the user go to checkout page (no AMP page, and not served by Google cache) there are no products on the shopping cart.
I guess it will be because when the article is added it is in a domain (google) and the payment page is in another domain, mine.
Is there any way to fix this?
I don't understand that google wants to provide a better user experience, and makes it so difficult to create a simple product page
Sorry you're hitting problems.
Here is the most relevant guide for your situation. In short, you want to transfer some kind of identifier from the AMP version of the page to your backend, and use that to sync the user state.
Without more information on your seutp, it is hard to get more specific.
source: work at Google on AMP
Are you looking for a way to make sure the user's cart is retained, whether they try to add to cart on an AMP cache or on your origin?
If so, there's a nice way described in detail here:
https://blog.amp.dev/2020/06/16/amp-camp-cross-origin-user-state-in-amp/

Wordpress Custom Menu - how to dynamically link to current user's page

In the Wordpress Menus Custom Links, I want to create a page called "My Page", and when the Current User clicks this Custom Link, it takes him to his specific page.
E.g mydomain.com/%CURRENT USERNAME% /
mydomain.com/johnsmith
Reading other posts, it appears that the Wordpress Custom Link understands only a static URL, not a dynamic one.
Therefore I need some way for the system to "get" the current user info, and redirect accordingly.
I have viewed the replies at this previous thread and here but I am still lost.
My coding ability is even less than the first guy's (but I do try!), so I can understand the theory, but I don't understand the technical language.
Therefore, I understand "You need to place this code, in your Theme Functions/in the script of the page".
But I don't understand "You need to run a jQuery with this code"
What information can I enter in the Custom Link to achieve this?
What code do I need to enter in the back-end to read this information correctly?
Thank you very much.

Wordpress - displaying different pages depending on user

I am using WooCommerce to build a e-commerce website. The business broadly has a few different types of users to get a variety of tasks done. The types are given below;
1) Administrators
2) Distributors
3) Customers
I could achieve the above with the given pre built user types that woocommerce provides.
What i aim to do is to display specific pages depending on who is signed in. Obviously, the three have their own tasks that they need to carry out on the website.
Here for example, I would want the Administrators to view a few extra page in the menu bar.
where as, customers will have their shopping catalogue to view and carry out their checking out experience as built with woocommerce.
I have had a look around different plugins that could possibly achieve this, but couldn't find any yet.
There are many ways to accomplish this task. One way would be to create a page and a page template, that redirects to another page, based on the user's role. Then those pages could re-direct if a user of an invalid role tried to access them. So the do_somthing.php page could redirect to the admin_do_somthing.php, distributors_do_somthing.php and customers_do_somthing.php, and each of those 3 would throw and error or re-direct to the home page if accessed by a user, or anonymous HTTP request, with a different role.
Keywords to lookup: "Worpress pages" "Wordpress templates" "Wordpress user roles" "wp_redirect()"

Creating Dynamic Menu Links Outside of Drupal Cache

For our Drupal 7 Commerce site we are trying to create a "portal system". I have it set up with all of the content at this point with all of the content referencing the same taxonomy to filter the respective products and content into either "portal one", "portal two", or both in the same. I have also already set up all the views and content types to display the content appropriately. Everything is 100% but now I need to use either session data or cookies to let the user (anonymous and authenticated) to choose from a pop up with "portal one" and "portal two" (this is already created as well) and change the urls on the main menu accordingly.
Currently the site is set up to have testsite.com/portal1/products as the url for portal 1 products and test site.com/portal2/products as the url for portal 2. The urls are set up exactly the same as this for all of the other content and views.
I also realize that this will get somewhat complex when dealing with users entering the site to internal links. A logic diagram has already been laid out, but that is a point of concern as well.
Session data or cookies would be the way to go. You would want to set this when the user selects a portal. Then, you would check that the user is on the right portal by getting the current url. I'm positive there is a Drupal hook for this.
For reading the cookie/session data there are a couple ways to do this. Firstly, you would probably need to create a module to do this. Drupal has rules and hooks so that you could run your portal routing code only on specific pages. The other option is to run that code on every page load, but that is not recommended by Drupal and it's followers.

Is there a way to add Facebook Like buttons to lots of products?

I know how to add a Facebook like button for a group or page, but is it possible to add a like button to every product in a web store without having to create a group or page for each product?
This was originally asked on StackExchange Web Apps Private Beta here.
If each product you want users to be able to like has it's own web page (like a product detail page), then you can setup the Open Graph tags on each page, and have buttons with a custom href pointing to them:
<fb:like href="http://mystore.com/product-1"></fb:like>
Yeah you can. Now with Facebook, you can "like" almost everything. You just have to implement it the way you'd do it for a page, or a quote. You can put it in your display loop/function.
I hope I was of any help.

Categories