AdWords
1.7K members online now
1.7K members online now
Use AdWords conversion tracking and reporting to measure your results. Have a question about Google Analytics? Post it here, on the Google Analytics Community!
Guide Me
star_border
Reply

Conversion Tracking Code For PHP

Follower ✭ ☆ ☆
# 1
Follower ✭ ☆ ☆

Guys,. 

 

I've a webpage in php & I need to put the conversion tracking code on it. Can anyone explain for me where to do it exactly?

Re: Conversion Tracking Code For PHP

Participant ✭ ✭ ✭
# 2
Participant ✭ ✭ ✭

Hi Mahmoud-Magdy,

 

Welcome to the forum,

 

To use Conversion Tracking, you'll need to put a small snippet of HTML code on the page that customers see after they've completed an action on your site (thank you page).

 

Here is the details with more information:

 

Setting Up Conversion Tracking

 

 

Re: Conversion Tracking Code For PHP

Collaborator ✭ ✭ ✭
# 3
Collaborator ✭ ✭ ✭

Hello Mahmoud and Shuva,

 

If you cannot spot where the php code is , click on that help page on "Track transaction specific values" , than on PHP and it explains how to delete this line in the HTML implementation

 

var google_conversion_value = 10;

 

and replace it with

 

if (<? echo $totalValue ?>) {
var google_conversion_value = <? echo $totalValue ?>
}

 

These are the instructions ( just quoting from the help file )

 

  1. Open your conversion confirmation page PHP file. If multiple pages are generated from the same file, find the section in the PHP file which generates your conversion page.
  2. If your site has a variable conversion value, determine the PHP expression that displays that value. For example: <?php echo $totalValue ?>, <? echo totalValue ?>
  3. Choose the Purchase/Sale conversion type while going through the conversion tracking setup.
  4. Enter a default numeric value in the “Conversion value” field, then replace the line “var google_conversion_value = …” manually with the following
      if (<%= totalValue %) {
       var google_conversion_value = <%= totalValue %>;
       }
    You’ll also need to add replace the default numeric value with “<%= totalValue%>” in the <noscript> section of the tag highlighted above.
  5. Copy and save the resulting code snippet.
  6. Insert the conversion tracking code onto the conversion confirmation page. Make sure that the code appears within a static HTML section, not contained within an PHP code section (delineated by <? and ?> markers). As you insert the code snippet, make sure you place it directly into the body of the conversion confirmation page. To make sure you do, search for the </body> tag and place the code immediately above it. Or, if the </body> tag is not located within the static portion of the HTML page, make sure that you add the code snippet so that it appears within the <body> section of the page as shown below.
  7. Save your conversion confirmation file and upload to your web server if necessary. If you'd like to test the placement of your conversion tracking code, go to your conversion page by completing a conversion on your site. View the source of the page (in Internet Explorer choose View > View Source). You should see the conversion tracking code between the <body> and </body> tags on your page. Note that the PHP expression will be replaced by the actual conversion value when you view the source.

Re: Conversion Tracking Code For PHP

Follower ✭ ☆ ☆
# 4
Follower ✭ ☆ ☆

I don't have access to a conversion page. I can get the network to do a postback to my URL that will contain conversion tracking.  Is there an article on how to do this somewhere? I need to track converting keywords/ads in Adwords with offes that convert. Thanks!

Re: Conversion Tracking Code For PHP

Collaborator ✭ ✭ ✭
# 5
Collaborator ✭ ✭ ✭

Hello,

 

I am sure that there is a solution to what you are asking, but I have no experience with this scenario of tracking conversions so my advice would be to post the question either in this similar thread :

 

https://www.en.adwords-community.com/t5/Measure-results/conversion-tracking-with-no-thank-you-page/m...

 

or as a new message , for maximum visibility as every forum user will see it in the shortlist of "Unanswered" messages in their profile under the avatar on the left.