Manipulate Product Revenue

Increase the revenue of your most important products to improve your Smart Shopping results. Use this script in GTM.

Start Now!
Manipulate Product Revenue with Google Tag Manager
Manipulate Get started!

With the introduction of Smart Shopping, Google cut a lot of control away from PPC marketers. After starting a campaign, there is nothing you can do, or even see, about keyword-matching, placements, prioritizing products or new customer acquisition. To get one of these things back, use the following script.

Difficulty

Category
Scripts

Tags

Change product revenue in Google Tagmanager

With this script, you can manipulate the productrevenue for Google Ads. This will only work when you're using a Google conversionpixel in GTM. 

First off, you'll have to define your hero-products. So what products are most important for your business? And what products bring in the most new customers? These products are worth more to you, then just the revenue they make. For these products, we'll increase the revenue so make them more important to the Smart Shopping algorithm.

Secondly, you'll have to calculate what the increased importance of these hero-products is worth to you. For all these products, a multiplier will be used in the script. For instance: if one of your products price is set to $10 and your multiplier is set to 1.2, a product revenue of $12 will be reported back to Google Ads on that product.

Set tag in GTM

Use a Google Ads conversionpixel in GTM and set it like this example:

The variable in het 'Items'-field is a Javascript-Macro variabele with the code you find below.

Settings

  1. Collect the product-ID's of your hero-products. You can add these on the second line of this script. Like the 'XX', 'YY', 'ZZ' in the example, you can add as much products as you wish. Put the quotes around them and split them by a comma. Make sure the brackets are around the whole line-up of product-ID's.
  2. Define your multiplier and set in on line 7. In the example, 1.25 is equal to 25% higher revenue.
The script
function() {
  	var heroProducts = ['XX','YY','ZZ'];
	var productInfo = [];
	var products =  {{DLV - Transaction - Products}};	
	for(var i = 0; i < products.length; i++){
      if(heroProducts.indexOf(products[i].id) > -1){
      	var price = products[i].price * 1.25;
      } else {
        var price = products[i].price;
      }
      
      productInfo.push({"id" : products[i].id, "quantity" : products[i].quantity, "price" : price});
    }
  	return productInfo;
}
Show whole script!
Loading Comments
The Experts
Tibbe van Asten Team Lead Performance Marketing
Nils Rooijmans Water Cooler Topics
Martijn Kraan Freelance PPC Specialist
Bas Baudoin Teamlead SEA @ Happy Leads
Jermaya Leijen Digital Marketing Strategist
Krzysztof Bycina PPC Specialist from Poland
How about you? JOIN US!
Sharing Knowledge
Caring

Adsscripts.com is all about sharing knowledge. In the current market, PPC specialists like to keep their knowledge and experience to themselves. We're convinced that sharing knowledge can ensure that everyone gets better at their work. We want to change this by sharing our knowledge about scripts with everyone.

Do you also want to contribute? We are open to new ideas and feedback on everything you find on Adsscripts.com.

Contact us

Training &
Workshop
Contact us!
Adsscripts Training & Workshop