Google::Adwords::Image - A Google Adwords Image object.


Google-Adwords documentation  | view source Contained in the Google-Adwords distribution.

Index


NAME

Top

Google::Adwords::Image - A Google Adwords Image object.

VERSION

Top

This documentation refers to Google::Adwords::Image version 0.0.1

SYNOPSIS

Top

    use Google::Adwords::CreativeService;
    use Google::Adwords::Creative;
    use Google::Adwords::Image;

    use File::Slurp;

    # create the CreativeService object
    my $creative_service = Google::Adwords::CreativeService->new();

    # need to login to the Adwords service
    $creative_service->email($email_address)
                     ->password($password)
                     ->developerToken($developer_token)
                     ->applicationToken($app_token);

    # if you have a MCC
    $creative_service->clientEmail($client_email);
    # or 
    $creative_service->clientCustomerId($customerid);

    # Lets add an image creative
    my $data_blurb = read_file('image.gif');

    my $image   = Google::Adwords::Image->new
            ->name('Image #1')
            ->data($data_blurb)
            ->type('image');

    my $creative_image = Google::Adwords::Creative->new
            ->adGroupId($adgroupid)
            ->destinationUrl('http://www.example.com')
            ->displayUrl('http://www.example.com')
            ->image( $image );

    my $addcreative     = $creative_service->addCreative($creative_image);
    print "Added Creative ID: " . $addcreative->id . "\n";
    print "Image Height: " . $addcreative->image->height . "\n";







DESCRIPTION

Top

This object should be used with the CreativeService API calls

METHODS

Top

Mutators (read/write)

* data

 This field is a binary string of data that will be base64 encoded. 
 The easiest is to slurp the file with File::Slurp::read_file and
 provide the binary string to the data method.

* name - The name of this image. This field is required at creation time, but cannot be changed afterwards.

* type - The type of this image

Accessors (read only)

* height - The height of this image in pixels. This field is calculated by the CreativeService and cannot be changed.

* width - The width of this image in pixels. This field is calculated by the CreativeService and cannot be changed.

* imageUrl - After you have created an image ad, you can use this URL to fetch the image or to link to it. This field is determined by the CreativeService and cannot be changed.

* thumbnailUrl - After you have created an image ad, you can use this URL to fetch or link to a thumbnail version of the image. The thumbnail image is created by the CreativeService and the URL to it cannot be changed. This field will be null if a thumbnail image cannot be generated.

* mimeType - The mime type of this image. This field is determined by the CreativeService and cannot be changed.

SEE ALSO

Top

* Google::Adwords::CreativeService
* Google::Adwords::Creative
* File::Slurp

AUTHOR

Top

Rohan Almeida <rohan@almeida.in>

LICENSE AND COPYRIGHT

Top


Google-Adwords documentation  | view source Contained in the Google-Adwords distribution.