Capturing HTTP network sessions can be a powerful troubleshooting exercise, allowing you to capture live ad requests and Ad Manager interactions. In addition, providing network sessions to Ad Manager support can help expedite issue resolution time by providing the necessary details to troubleshoot.
Learn about capturing web session traffic using Chrome DevTools
If you are using the Google Mobile Ads SDK, refer to the network tracing guide for Android or iOS. Using network tracing instead of proxy tools ensure you will see all traffic for all versions of these operating systems.
Alternatively, using a debugging proxy application such as Charles or Fiddler, you can also record both mobile web and mobile app network traffic from a mobile device.
Requirements
- A web debugging proxy, such as Charles or Fiddler
- A Wi-Fi network that allows peer-to-peer traffic
- A desktop or laptop computer
- An iOS or Android mobile device
Proxy configuration
-
Get your local IP address from your desktop or laptop computer:
- Windows: open Command Prompt. Type in
ipconfig
and press Enter. The text next to "IPv4 Address" is your local IP address. - macOS: open Terminal. Type in
ifconfig en0| grep "inet[ ]" | awk '{print $2}'
and press Enter. The result will be your local ip address. - Linux: open the terminal. Type in
ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'
and press Enter. The result will be your local ip address.
- Windows: open Command Prompt. Type in
-
Tell your mobile device about your desktop's IP:
-
Android
- Click Settings, then Wi-Fi and select your Wi-Fi network.
- Select the "Show advanced options" check box.
- Under "Proxy settings", select the manual option and enter the IP address from step 1 in the "Proxy hostname" field.
- Enter 8888 in the "Proxy port" field.
- Click Save.
-
iOS
- Click Settings, then Wi-Fi and select your Wi-Fi network.
- Under "HTTP Proxy", click Manual.
- Enter the IP address from step 1 in the "Server" field.
- Enter
8888
in the "Port" field. - Close out.
-
-
Configure your web debugging proxy tool:
- Set the HTTP proxy port to
8888
. - (Charles only) If the "External Proxy Setting" is selected, deselect it.
- (Fiddler only) Select the "Allow remote computers to connect" option.
- Set the HTTP proxy port to
-
Set up SSL (Charles only):
- In the menu bar, go to Proxy, then SSL Proxy Settings.
- Click Add.
- Enter
securepubads.g.doubleclick.net
andgoogleads.g.doubleclick.net
in the "Host" field and443
in the "Port" field.You may also consider capturing all traffic by entering the wildcard "*" in the "Host" field while leaving the "Port" field blank. This can be useful when there's an issue outside the above two domains.
- Click OK.
- Install the Charles certificate using the Charles SSL setup guidelines.
- Once your device is proxying to your desktop/laptop machine, go to your phone's browser and type
http://charlesproxy.com/getssl
to download and install the machine certificate.
-
Start capturing HTTP traffic from your mobile phone (Charles only):
- When prompted to allow your mobile device to connect, select Allow.
- When you have finished capturing network traffic, be sure to turn off the proxy settings on your device by reversing step 2 (set proxy to None).
Considerations
- Google does not endorse Charles or Fiddler HTTP Proxy in any way and you may use it at your own risk.
- The HTTP proxy software can capture any activity from your device. Be sure to deactivate the proxy when finished recording the relevant traffic.