Print Page | Close Window

Automated Google shopping products.txt generation

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=4339
Printed Date: 04-July-2025 at 11:48pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Automated Google shopping products.txt generation
Posted By: Brett
Subject: Automated Google shopping products.txt generation
Date Posted: 26-February-2011 at 2:40pm
I find myself having to manually generate my products.txt for google shopping every month because products can't be submitted with an expiration date more than 30 days away.

Has anyone had luck creating some kind of cron job to automatically generate this file daily, or something similar?



Replies:
Posted By: whizzinpc
Date Posted: 28-February-2011 at 7:38pm
I have setup an auto ftp to google shopping to update the file stored on my pc on a monthly basis. This way even if the file has not been updated it will upload the latest copy so the products don't expire. It's been working fine so far.

Actually, the scheduled ftp uploads to our server and I have google shopping pointing to that url to download it every month.


Posted By: Brett
Date Posted: 28-February-2011 at 10:31pm
I set mine to auto submit to google on a daily basis, but this won't help if the expiration date is set to a time which is in the past. For example, say I generate the file today. I must choose 3/28 as the expiration date otherwise it will be "too far in the future". So, the spreadsheet is auto submitting to google every day until 3/28 at which point I will need to manually re-generate the spreadsheet.

Or am I missing something?


Posted By: avalight
Date Posted: 01-March-2011 at 4:06pm
In the Google merchant center, under the datafeeds you can set up an automatic upload, weekly, daily, monthly, directly from your server, so you don't need to worry about forgetting to manually do the upload.  In the product.txt itself, don't put in an expiration date either.
I create the file in access, btw, separate from the productcart site, because I want more control over the output.


-------------
Curt


Posted By: whizzinpc
Date Posted: 01-March-2011 at 5:05pm
I don't put an expiration date in the feed. It auto expires monthly anyway.


Posted By: avalight
Date Posted: 01-March-2011 at 6:18pm
Well, now I am confused.  I created a product.txt file and manually uploaded it the first time.  Then I set an automatic upload to be done once a month, using the same file located on my root directory.  It did the upload once a month, for several months, until I created a new file.  But all the while, it just took the old file and did the upload.  My understanding was the upload needs to happen once a month, or the product feed stops.

-------------
Curt


Posted By: ProductCart
Date Posted: 01-March-2011 at 7:03pm
You can do it both ways, but the scheduling feature automates it for you. Please see our documentation. We believe it explains this pretty clearly. http://wiki.earlyimpact.com/productcart/marketing-generate_google_base_file#uploading_or_scheduling - See ProductCart WIKI : "Point Google Base to a URL on your Web site to take advantage of the scheduling feature".

-------------
The ProductCart Team

Home of ProductCart http://www.productcart.com" rel="nofollow - shopping cart software


Posted By: whizzinpc
Date Posted: 02-March-2011 at 1:42pm
The file has to be on your server not on local computer. Then you just point Google base to that url... which you need to update when you create a new feed. With this method you can avoid Google dropping your products.


Posted By: Brett
Date Posted: 03-March-2011 at 5:46pm
Yeah the Products.txt file is on my server. I go to exportFroogle.asp and generate the feed, and google merchant center is set to automatically download it from my server every day. However, don't I need to manually generate the Products.txt file every 30 days to avoid the file expiring? What I'm looking to do is automatically re-generate Products.txt on my webserver daily so it constantly reflects my current products. Google already automatically downloads the file from my website every day, but I don't see how the file is being updated unless I manually go to exportFroogle.asp and re-generate it.


Posted By: Brett
Date Posted: 04-March-2011 at 5:38am
This modified exportFroogle.asp file can be run without any input to automatically update the Products.txt file. You should be able to set up the configuration variables and schedule a task to run it as often as you want your file to be updated.

Put this file in the same folder as your exportFroogle.asp file:
uploads/1159/exportFroogleAuto.zip - exportFroogleAuto.zip

*I haven't been able to test running it with a scheduled task yet, but I did run it in my browser and compared the output with the original script output to make sure they were identical.


Posted By: Brett
Date Posted: 08-March-2011 at 3:03pm
So,

Apparently scheduling stuff on a Windows server is quite a bit trickier than setting up a cron job with Linux. Plus, a script should "just work", not require a bunch of configuration. With that in mind, I'm looking to set up a "fake schedule" for this script by including a small snippet into my AdminHeader.asp file. I'm also considering putting this snippet in menu.asp instead. We'll see. Anyways here's the code:


'// Automated Google Products Submission
If DateDiff("d", Application("LastScheduledRunD"), Now()) > 0 Then
    ' This is where you put the commands you want to run on the
    ' schedule set up by the above condition.
    Application.Lock
    Application("LastScheduledRunD") = Now()
    Application.UnLock     
     Response.Redirect("exportFroogleAuto.asp")

End If
'// END Automated Google Products Submission


Now, what I'd like to put at the bottom of exportFroogleAuto.asp is a redirect to take you back to where you were. I figured:

Response.Redirect(Request.ServerVariables("HTTP_REFERER"))

Would do the trick, but unfortunately it doesn't. It looks like HTTP_REFERER is not set when a page is redirected to with response.redirect. So, I figured I would simply redirect it to menu.asp. However, for some reason none of my response.redirect calls are working on this script.

Does anyone know how I can get this exportFroogleAuto.asp script to redirect you to menu.asp after it's generated the .txt file?

*Edit*

This is where I found the great advice for scheduling ASP files:
http://www.asp101.com/articles/john/schedule/default.asp


Posted By: Brett
Date Posted: 01-April-2011 at 2:23pm
If anyone was still interested in this, I finally got around to finishing it. Use this file to overwrite your Menu.asp (MAKE SURE YOU BACKUP FIRST - or just run a file comparison program to see what changes were made on menu.asp) Then, upload the other file into the same location as your menu.asp file (pcadmin/) You'll need to edit exportFroogleAuto.asp and configure the variables at the top of the file.

Once it's setup, the first admin to log in each day (the first person to view menu.asp) will trigger exportFroogleAuto.asp and the new feed will be generated. A message will be displayed on Menu.asp notifying that the feed was generated, and a link is provided so you can double check the new feed if you'd like to.

I've been using it on my site for the past week or so, and it appears to be updating the feed daily. New products are being added to our Google Product Search listing without me having to manually generate the feed.

*edit*

Whoops, forgot the files...

uploads/1159/AutoGenGPF.zip - AutoGenGPF.zip


Posted By: whizzinpc
Date Posted: 07-April-2011 at 6:15pm
Very Nice! A couple of suggestions. It would be helpful if it created the canonical url. Also, have input fields to add google tracking code.
&utm_source=user input
&utm_medium=user input
&utm_campaign=user input
&utm_term=user input or sku



Posted By: Greg Dinger
Date Posted: 07-April-2011 at 6:37pm

Art - on that point, we did something interesting for a client recently.

They are adding querystring variables to their PPC placement in the form of
 
domain.com/store/pc/somepage.asp?keyword=xxxxx&source&yyyyy
 
We capture those keyword and source values upon arrival to the site, store them along with the order, and then we provided a report/export module at the back end for analysis.
 
This code could be bundled up for anyone who had such an interest.
 


-------------
GreyBeard Design Group

Certified ProductCart Developer

Web Design/Development/Hosting

http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |


Posted By: whizzinpc
Date Posted: 08-April-2011 at 12:46pm
If I understood correctly... the order will show what campaign it came from directly in the control panel order details rather than having to check google analytics. I can see how this would be useful.


Posted By: Greg Dinger
Date Posted: 08-April-2011 at 1:38pm
yes, we show the source of the sale (when it came from a PPC campaign) in the order admin AS WELL AS providing an export tool so you can develop internal reporting of metrics.

-------------
GreyBeard Design Group

Certified ProductCart Developer

Web Design/Development/Hosting

http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |


Posted By: whizzinpc
Date Posted: 08-April-2011 at 1:51pm
We could definitely use that.


Posted By: Greg Dinger
Date Posted: 08-April-2011 at 2:02pm
Give me a call.  The code is in a 4.04 store with other mods so we just need to carve out these pieces and move them to whatever version you are running.

-------------
GreyBeard Design Group

Certified ProductCart Developer

Web Design/Development/Hosting

http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |


Posted By: Brett
Date Posted: 10-April-2011 at 4:38pm
Originally posted by whizzinpc whizzinpc wrote:

Very Nice! A couple of suggestions. It would be helpful if it created the canonical url. Also, have input fields to add google tracking code. &utm_source=user input&utm_medium=user input&utm_campaign=user input&utm_term=user input or sku


I'll see if I can get some time to incorporate these into it. Where would the google tracking code be added? On a per-product basis or one for the entire feed?



Posted By: whizzinpc
Date Posted: 11-April-2011 at 1:59am
It would be per feed.
A text input field for each
utm_source=
utm_medium=
utm_campaign=
and
utm_term=
for utm_term it can just be the sku of the product. So this one would be automatic.


Example:
http://www.abc.com/productcart/pc/red-widget-p312.htm?utm_source=google-base&utm_medium=CPC&utm_campaign=Google-Feeds&utm_term=red-widget



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net