want a redirection drop-down menu of city wise stores for multi store in opencart - redirect

I am running multi store city wise on Opencart. I want to have a dropdown list of my stores on main store. So, visitors can select their city and they should be redirected to that store and will be saved in cookies. So, next time when they visit my website they should be automatically diverted on their past selection of city.
My store is www.orgoearth.com
multi stores are www.city.orgoearth.com for example www.vadodara.orgoearth.com

You can handle this city based URL redirection in Opencart url handler
seo_url.php [path:catalog/controller/startup/seo_url.php].
In this file, you can set the cookies and check the cookies condition everytime.

Related

Capturing URL from Form Submission Tracking - Google Analytics

I'm looking to record the URL from which a form submission was sent from with Google Analytics.
Example:
Imagine domain.com. On domain.com Google Analytics (ga.js) is installed in the header.php and is on every page of the site. Similarly, in domain.com's footer.php there's the same contact form generated on every single page of the site.
Now, User 1 goes to domain.com. User 1 navigates to domain.com/page-c.html. User 1 submits a form from the footer contact form on page-c.html.
I want to know that a form was submitted from page-c.html. Or if User 2 submits from page-u.html then I know that a form was sent from page-u.html. It is not important that I know that it is User 1 or User 2. I just want to know the URL from which the form was sent.
Anyone know how to do this with Google Analytics? -- If not, maybe another analytics service?
You can use Google Tag Manager. Which can not only implement all the standard analytics capabilities but also lets you add event triggers with built-in variables. For example you'd enable the Page URL variable in GTM and add a Analytics Tag of type Event with Event Category, Action, Label being things like Contact Form, Submit, {{Page URL}} respectively. Then create a new trigger (triggers tell when to fire a tag). This trigger should be enabled always (i.e. something like PagePath contains / and be of type Form Submission. You can target it even better by saying trigger when to be when the Form ID is equal to the ID attribute of your contact form. This way you prevent conflicts with other forms triggering your event tag.
You can read extensively on Google Tag Manager here. It is a great tool to fine tune analytics and get more out of it.

Append Form text field value alone in the url

I am trying to create a sample Online shopping application using SPRING+REST. I have a 1000 of products and I would like to make use of #RequestMapping("watches/{id}") annotation . But i dont know how to send the id form field value alone while submitting a form in jsp.
I want something like this
www.example.com/watches/1001
Please help me out
I guess you will have some jsp page which consists of all watches. This web page can be access by localhost:8080/watches URL.
If user click on any watches, user will land to localhost:8080/watches/{watch-id} page as the click on watch will redirect the request.
If your JSP is form based page, then user need to enter the watch-id ( or watch name which we need to map to watch id) and click on submit button will redirect the request to localhost:8080/watches/{watch-id}. Please let me know if you are ok with this.

Real time Google Script Form changes (triggers, onEdit())

How do you change items in Forms from user triggered events during live user interaction with the Form?
I got three ListItems in my form. They all got the same choices to choose from. Users get to choose an activity. If they don't get their choice in the first ListItem they might get it in the second or third.
When a user choose an activity from one of the three ListItems I want to remove this choice of activity from the other two ListItems so that it's not possible to choose the same activity multiple times.
How do you do this? There's an onEdit() function for Spreadsheets but what about Forms?
The live Google Forms cannot be modified based on user interaction.
What you can do is create sections (or branches) and redirect the user to a different section based on the value they've entered in a particular field.

Callback from Facebook app as a tab app on multiple pages

Salon owners can create an account with their salon information on our platform and they get a page that they can use as a tab app.
I want to be able to serve all these pages from one app instead of having to install each one seprately and I also want to make the life of the salon owner easier by helping them to install the tab.
I know about the link I can create to help them install the app and I know that when a visitor visits the app that facebook will send the page ID. So far so good.
https://developers.facebook.com/docs/appsonfacebook/pagetabs/
But how do I make sure that when the salonowner follows the link to install the app that I get the page ID back (through callback or other) so that I can register which page ID belongs to which salon account.
I've read sone 2011 article about a callback but I can't find any recent info on this.
I think it should be possible as a lot of sites offer easy fb apps to businesses.
Any help would be welcome!
EDIT: Could this last piece of info in the Facebook link above be used to do this? I don't quite get it yet.
In addition, your app will also receive a string parameter called app_data as part of signed_request if an app_data parameter was set in the original query string in the URL your tab is loaded on. It could look like this: "https://www.facebook.com/YourPage?v=app_1234567890&app_data=any_string_here". You can use that to customize the content you render if you control the generation of the link.
Well... Preventing users from adding your application to their page is impossible. You can't prevent that.
What you will be able to do is to detect who has added your application and according to that, change the content (or not display it at all). So you'll have to start with a list of "allowed" page_ids to match to the accounts you want.
Your application will receive a signed_request each time a user arrives at your application (within a page). Inside that signed_request is information not only on the user but also on the page that the application is on (provided it is a page tab app).
Once you have obtained the signed_request, it will hold a page key which contains:
A JSON object containing the page id string, the liked boolean (set to
true if the user has liked the page, false if not) and the admin
boolean (set to true if the user is an admin of the page, false if
they're not). This field is only present if your app is being loaded
within a Page Tab.
So you'll be able to access the page_id from within this variable and make a decision on the type of content you want to be displayed.
Ok, after running some tests I found out that when you add a URL as 'next' parameter to the install URL Facebook will send the admin(user) back to this URL while adding an array to the request containing all the page Id's the app was installed to.
Like this: YOUR_CALLBACK_URL?tabs_added[ID]=1
Proved to be quite easy in the end

Adsense with dynamic content

I know that this topic has been discussed before in varying extent but I have some specific queries. I will use an example for this case and would like to request you for your views.
Example:- A home finance management website. There are two pages. The basic page after login is an empty page with a text box. Type in "Rent" and rent details and trends pop up. Type in "Bills" and bill details and history pop up. The data shown to user is different of course.
Now -
1. If I place an Adsense script in the basic home page where I just have a text box, will it be disqualified for not having enough content ?
2. Even if the content changes (AJAX), does the ad change to suit the content ? Does the crawler keep a constant check of index the pages after defined intervals and whatever it finds there is kept and searched for keywords ? The same page may show different content to different users and hence have different keywords. (Also, since login would be cookie based, how does crawler see this page ?)
Edit -
I know from HERE that Google does take AJAX calls into account but since the results would be dynamically populated by accessing a database and while populating unique data, the bot looking at the form action page doesn't help much, does it?
3. Google prefers GET method. So if I go like this - xyz.com?show=rent / xyz.com?show=bills, the page is regenerated and the script reloaded but each time the crawler sniffs any one of the two pages, it might see different content for different users. What does it do ?
4. If I do not reload the page by form submission and the page is not regenerated every time, can I call a function to document.write the div I am putting the ad in ? Would that make it re-sniff the page ?
Any help is much appreciated.