使用表中的类的Jquery获取谷歌动态再营销标记的数据

时间:2014-02-23 11:35:29

标签: javascript jquery html css arrays

我试图提取数据并将其放入带有jquery的数组中,用于Google动态再营销代码。

使用css类 gr_row 值--- 加入ecomm_prodid ecomm_quantity ecomm_totalvalue参数

然后插入它们,如果有多个值,如果只有一个没有数组,则删除curreny符号。

    <!-multiple products in cart-->
<script type="text/javascript">
var google_tag_params = 
ecomm_prodid: ["123","234"],
ecomm_pagetype: "basket",
ecomm_totalvalue: [100,50]
};
</script>



 <!-single product in cart-->

<script type="text/javascript">
var google_tag_params = {
ecomm_prodid: 234,
ecomm_pagetype: "purchase",
ecomm_totalvalue: 120.99
};
</script> 

任何帮助表示感谢 google instructions add dynamic remarketing tag

<table class="checkout-cart" border="0" cellpadding="3" cellspacing="2" width="650">
  <tbody>
    <tr>
      <th "="" align="left" width="15%">REF</th>
      <th align="left" width="45%">DESCRIPTION</th>
      <th align="right" width="10%">QUANTITY</th>
      <th align="right" width="10%">PRICE</th>
      <th align="right" width="10%">COST</th>
      <th align="center" width="10%">REMOVE</th>
    </tr>
    <tr class ="gr_row">
      <td colspan="3" class="cart"><table border="0" cellpadding="0" cellspacing="0" width="100%">
          <tbody>
            <tr>
              <td class="ecomm_prodid" width="77"> 83 </td>
              <td valign="middle" width="43"><actinic:thumbnail></actinic:thumbnail></td>
              <td width="242">some product</td>
              <td align="right" class="ecomm_quantity" width="87"><input size="4" name="Q_0" value="1" style="text-align: right;" type="TEXT"></td>
            </tr>
          </tbody>
        </table></td>
      <td align="right" class="ecomm_totalvalue"> £5.79 </td>
      <td  align="right" class="ecomm_totalvalue"> £5.79 </td>
      <td rowspan="1" class="cart" align="center"><input name="D_0" type="CHECKBOX"></td>
    </tr>
    <tr>
      <td colspan="3" class="cart"><table border="0" cellpadding="0" cellspacing="0" width="100%">
          <tbody>
            <tr>
              <td class="ecomm_prodid" width="78"> 3571 </td>
              <td valign="middle" width="43"><actinic:thumbnail></actinic:thumbnail></td>
              <td width="241">another product</td>
              <td align="right" class="ecomm_quantity" width="87"><input size="4" name="Q_1" value="5" style="text-align: right;" type="TEXT"></td>
            </tr>
          </tbody>
        </table></td>
      <td class="cart" align="right"> £6.90 </td>
      <td class="cart" align="right"> £6.90 </td>
      <td rowspan="1" class="cart" align="center"><input name="D_1" type="CHECKBOX"></td>
    </tr>
    <tr>
      <td colspan="4" align="right"><b>Subtotal</b></td>
      <td class="cart" align="right">£12.69</td>
      <td rowspan="NETQUOTEVAR:REMOVEROWSPAN" align="center">&nbsp;</td>
    </tr>
    <tr>
      <td colspan="4" align="right"><b>VAT</b></td>
      <td class="cart" align="right">£2.54</td>
      <td rowspan="NETQUOTEVAR:REMOVEROWSPAN" align="center">&nbsp;</td>
    </tr>
    <tr>
      <td colspan="4" align="right"><b>Total</b></td>
      <td class="cartheading" align="right"><b>£15.23</b></td>
      <td rowspan="NETQUOTEVAR:REMOVEROWSPAN" align="center">&nbsp;</td>
    </tr>
  </tbody>
</table>

0 个答案:

没有答案