【发布时间】:2011-02-19 20:06:05
【问题描述】:
我正在构建一个在外部网站上进行转化跟踪的 Rails 应用。我希望允许用户在他们的转换页面(如 AdWords)中粘贴图像标记,并且每当请求该图像时,都会在我的应用中注册转换。
respond_to do |format|
if @conversion.save
flash[:notice] = 'Conversion was successfully created.'
format.html { redirect_to(@conversion) }
format.xml { render :xml => @conversion, :status => :created, :location => @conversion }
format.js { render :json => @conversion, :status => :created }
format.gif { head :status => :ok }
else
format.html { render :action => "new" }
format.xml { render :xml => @conversion.errors, :status => :unprocessable_entity }
end
end
这样,浏览器会得到一个不存在的 .gif 图像。有一个更好的方法吗?
【问题讨论】:
标签: ruby-on-rails tracking google-ads-api